Esempio n. 1
0
 /**
  * @param SAML2_Utilities_ArrayCollection $assertions
  *
  * @return SAML2_Assertion[] Collection (SAML2_Utilities_ArrayCollection) of processed assertions
  */
 public function processAssertions($assertions)
 {
     $processed = new SAML2_Utilities_ArrayCollection();
     foreach ($assertions as $assertion) {
         $processed->add($this->process($assertion));
     }
     return $processed;
 }
Esempio n. 2
0
 /**
  * Add a key to the collection
  *
  * @param SAML2_Certificate_Key $key
  */
 public function add($key)
 {
     if (!$key instanceof SAML2_Certificate_Key) {
         throw SAML2_Exception_InvalidArgumentException::invalidType('SAML2_Certificate_Key', $key);
     }
     parent::add($key);
 }
Esempio n. 3
0
 /**
  * Add a key to the collection
  *
  * @param SAML2_Certificate_Fingerprint $fingerprint
  */
 public function add($fingerprint)
 {
     if (!$fingerprint instanceof SAML2_Certificate_Fingerprint) {
         throw SAML2_Exception_InvalidArgumentException::invalidType('SAML2_Certificate_Fingerprint ', $fingerprint);
     }
     parent::add($fingerprint);
 }
Esempio n. 4
0
 /**
  * @param SAML2_Configuration_DecryptionProvider $identityProvider
  * @param SAML2_Configuration_DecryptionProvider $serviceProvider
  *
  * @return SAML2_Utilities_ArrayCollection
  * @throws Exception
  */
 public function loadDecryptionKeys(SAML2_Configuration_DecryptionProvider $identityProvider, SAML2_Configuration_DecryptionProvider $serviceProvider)
 {
     $decryptionKeys = new SAML2_Utilities_ArrayCollection();
     $senderSharedKey = $identityProvider->getSharedKey();
     if ($senderSharedKey) {
         $key = new XMLSecurityKey(XMLSecurityKey::AES128_CBC);
         $key->loadKey($senderSharedKey);
         $decryptionKeys->add($key);
         return $decryptionKeys;
     }
     $newPrivateKey = $serviceProvider->getPrivateKey(SAML2_Configuration_PrivateKey::NAME_NEW);
     if ($newPrivateKey instanceof SAML2_Configuration_PrivateKey) {
         $loadedKey = $this->loadPrivateKey($newPrivateKey);
         $decryptionKeys->add($this->convertPrivateKeyToRsaKey($loadedKey));
     }
     $privateKey = $serviceProvider->getPrivateKey(SAML2_Configuration_PrivateKey::NAME_DEFAULT, TRUE);
     $loadedKey = $this->loadPrivateKey($privateKey);
     $decryptionKeys->add($this->convertPrivateKeyToRsaKey($loadedKey));
     return $decryptionKeys;
 }