/** {@inheritDoc} */ public Iterable<EncryptedKey> resolve(EncryptedData encryptedData) { return resolveKeyInfo(encryptedData.getKeyInfo(), depthLimit); }
/** * Get the optional static set of criteria used when resolving credentials based on the KeyInfo of an EncryptedData * element. * * @return the static criteria set to use * @deprecated due to typo, use {@link #getKeyResolverCriteria()} */ public CriteriaSet setKeyResolverCriteria() { return getKeyResolverCriteria(); }
/** * Constructor. */ public KeyEncryptionParameters() { super(); // The default supplied by the super class doesn't make sense, // can't autogenerate a key encryption key, always needs to be derived // from the key in the (for KEK, mandatory) encryption credential. setAlgorithm(null); }
/** * Constructor. */ public EncryptionParameters() { // This will be the default for auto encryption key generation setAlgorithm(EncryptionConstants.ALGO_ID_BLOCKCIPHER_AES256); }
/** * This is a convenience method for calling {@link #decryptData(EncryptedData, boolean)}, * with the <code>rootInNewDocument</code> parameter value supplied by {@link #isRootInNewDocument()}. * * @param encryptedData encrypted data element containing the data to be decrypted * @return the decrypted XMLObject * @throws DecryptionException exception indicating a decryption error, possibly because the decrypted data * contained more than one top-level Element, or some non-Element Node type. */ public XMLObject decryptData(EncryptedData encryptedData) throws DecryptionException { return decryptData(encryptedData, isRootInNewDocument()); }
/** * This is a convenience method for calling {@link #decryptDataToList(EncryptedData, boolean)}, * with the <code>rootInNewDocument</code> parameter value supplied by {@link #isRootInNewDocument()}. * * @param encryptedData encrypted data element containing the data to be decrypted * @return the list decrypted top-level XMLObjects * @throws DecryptionException exception indicating a decryption error, possibly because the decrypted data * contained DOM nodes other than type of Element */ public List<XMLObject> decryptDataToList(EncryptedData encryptedData) throws DecryptionException { return decryptDataToList(encryptedData, isRootInNewDocument()); }
/** * Constructor. * * @param resolver the ChainingEncryptedKeyResolver parent * @param encData the EncryptedData context for resolution */ public ChainingIterator(ChainingEncryptedKeyResolver resolver, EncryptedData encData) { parent = resolver; encryptedData = encData; resolverIterator = parent.getResolverChain().iterator(); keyIterator = getNextKeyIterator(); nextKey = null; }
spMetadata.getKeyPair().getPrivate()); StaticKeyInfoCredentialResolver keyInfoResolver = new StaticKeyInfoCredentialResolver(credential); EncryptedKeyResolver keyResolver = new InlineEncryptedKeyResolver(); Decrypter decrypter = new Decrypter(null, keyInfoResolver, keyResolver); decrypter.setRootInNewDocument(true); assertion = decrypter.decrypt(encryptedAssertion); } catch (DecryptionException e) { s_logger.warn("SAML EncryptedAssertion error: " + e.toString());
/** {@inheritDoc} */ public boolean hasNext() { if (nextKey != null) { return true; } nextKey = getNextKey(); if (nextKey != null) { return true; } return false; }
/** {@inheritDoc} */ public Iterator<EncryptedKey> iterator() { return new ChainingIterator(parent, encryptedData); }
/** * Encrypts the DOM representation of the XMLObject, encrypts the encryption key using the specified key encryption * parameters and places the resulting EncryptedKey(s) within the EncryptedData's KeyInfo. * * @param xmlObject the XMLObject to be encrypted * @param encParams parameters for encrypting the data * @param kekParamsList parameters for encrypting the encryption key * * @return the resulting EncryptedData element * @throws EncryptionException exception thrown on encryption errors */ public EncryptedData encryptElement(XMLObject xmlObject, EncryptionParameters encParams, List<KeyEncryptionParameters> kekParamsList) throws EncryptionException { return encryptElement(xmlObject, encParams, kekParamsList, false); }
/** {@inheritDoc} */ public Iterable<EncryptedKey> resolve(EncryptedData encryptedData) { return resolveKeyInfo(encryptedData.getKeyInfo(), depthLimit); }
/** * Constructor. */ public KeyEncryptionParameters() { super(); // The default supplied by the super class doesn't make sense, // can't autogenerate a key encryption key, always needs to be derived // from the key in the (for KEK, mandatory) encryption credential. setAlgorithm(null); }
/** * Constructor. */ public EncryptionParameters() { // This will be the default for auto encryption key generation setAlgorithm(EncryptionConstants.ALGO_ID_BLOCKCIPHER_AES256); }
/** * This is a convenience method for calling {@link #decryptData(EncryptedData, boolean)}, * with the <code>rootInNewDocument</code> parameter value supplied by {@link #isRootInNewDocument()}. * * @param encryptedData encrypted data element containing the data to be decrypted * @return the decrypted XMLObject * @throws DecryptionException exception indicating a decryption error, possibly because the decrypted data * contained more than one top-level Element, or some non-Element Node type. */ public XMLObject decryptData(EncryptedData encryptedData) throws DecryptionException { return decryptData(encryptedData, isRootInNewDocument()); }
/** * This is a convenience method for calling {@link #decryptDataToList(EncryptedData, boolean)}, * with the <code>rootInNewDocument</code> parameter value supplied by {@link #isRootInNewDocument()}. * * @param encryptedData encrypted data element containing the data to be decrypted * @return the list decrypted top-level XMLObjects * @throws DecryptionException exception indicating a decryption error, possibly because the decrypted data * contained DOM nodes other than type of Element */ public List<XMLObject> decryptDataToList(EncryptedData encryptedData) throws DecryptionException { return decryptDataToList(encryptedData, isRootInNewDocument()); }
/** * Constructor. * * @param resolver the ChainingEncryptedKeyResolver parent * @param encData the EncryptedData context for resolution */ public ChainingIterator(ChainingEncryptedKeyResolver resolver, EncryptedData encData) { parent = resolver; encryptedData = encData; resolverIterator = parent.getResolverChain().iterator(); keyIterator = getNextKeyIterator(); nextKey = null; }
/** * Get the optional static set of criteria used when resolving credentials based on the KeyInfo of an EncryptedData * element. * * @return the static criteria set to use * @deprecated due to typo, use {@link #getKeyResolverCriteria()} */ public CriteriaSet setKeyResolverCriteria() { return getKeyResolverCriteria(); }
/** {@inheritDoc} */ public boolean hasNext() { if (nextKey != null) { return true; } nextKey = getNextKey(); if (nextKey != null) { return true; } return false; }
/** {@inheritDoc} */ public Iterator<EncryptedKey> iterator() { return new ChainingIterator(parent, encryptedData); }