/** * Create key from an EncryptedKey-element. * * @param DOMElement $element The EncryptedKey-element. * @throws Exception * @return DBSeller_Helper_Xml_Security_SecurityKey The new key. */ public static function fromEncryptedKeyElement(DOMElement $element) { $objenc = new DBSeller_Helper_Xml_Security_XMLSecEnc(); $objenc->setNode($element); if (!($objKey = $objenc->locateKey())) { throw new Exception("Unable to locate algorithm for this Encrypted Key"); } $objKey->isEncrypted = TRUE; $objKey->encryptedCtx = $objenc; DBSeller_Helper_Xml_Security_XMLSecEnc::staticLocateKeyInfo($objKey, $element); return $objKey; }