/* 77 */ cipher = XMLCipher.getInstance();
/* 78 */ key = cipher.loadEncryptedKey(element);
/* */ }
/* */ catch (XMLSecurityException e)
/* */ {
/* 82 */ throw new WSSecurityException("Could not parse encrypted key: " + e.getMessage(), e);
/* */ }
/* */
/* 85 */ KeyInfo info = key.getKeyInfo();
/* */
/* 87 */ if (info == null) {
/* 88 */ throw new WSSecurityException("EncryptedKey element did not contain KeyInfo");
/* */ }
/* 90 */ PrivateKey privateKey = resolver.resolvePrivateKey(info);
/* */
/* 95 */ Element referenceList = Util.findElement(element, "ReferenceList", "http://www.w3.org/2001/04/xmlenc#");
/* 96 */ if (referenceList == null) {
/* 97 */ throw new WSSecurityException("Encrypted key did not contain a reference list");
/* */ }
/* 99 */ this.list = new ReferenceList(referenceList);
/* */
/* 102 */ String alg = getKeyAlgorithm(element);
/* 103 */ if (alg == null) {
/* 104 */ throw new WSSecurityException("Could not determine encrypted key algorithm!");
/* */ }
/* */ try
/* */ {
/* 108 */ cipher.init(4, privateKey);
/* 109 */ this.secretKey = ((SecretKey)cipher.decryptKey(key, alg));
/* */ }
/* */ catch (XMLSecurityException e)
/* */ {
/* 113 */ throw new WSSecurityException("Could not parse encrypted key: " + e.getMessage(), e);
/* */ }
/* */
/* 116 */ this.document = element.getOwnerDocument();
/* 117 */ this.token = new X509Token(resolver.resolveCertificate(info), this.document);
/* */ }