org.opensaml.saml2.encryption
Class Decrypter

java.lang.Object
  extended by org.opensaml.xml.encryption.Decrypter
      extended by org.opensaml.saml2.encryption.Decrypter

public class Decrypter
extends Decrypter

Class which implements SAML2-specific options for EncryptedElementType objects. See additional information about general XML decrytpion issues at Decrypter.


Constructor Summary
Decrypter(KeyInfoCredentialResolver newResolver, KeyInfoCredentialResolver newKEKResolver, EncryptedKeyResolver newEncKeyResolver)
          Constructor.
 
Method Summary
 Assertion decrypt(EncryptedAssertion encryptedAssertion)
          Decrypt the specified EncryptedAssertion.
 Attribute decrypt(EncryptedAttribute encryptedAttribute)
          Decrypt the specified EncryptedAttribute.
 SAMLObject decrypt(EncryptedID encryptedID)
          Decrypt the specified EncryptedID.
 NewID decrypt(NewEncryptedID newEncryptedID)
          Decrypt the specified NewEncryptedID.
 boolean isRootInNewDocument()
          Get the flag which indicates whether the DOM Element which backs a decrypted SAML object will be the root of a new DOM document.
 void setRootInNewDocument(boolean flag)
          Set the flag which indicates whether the DOM Element which backs a decrypted SAML object will be the root of a new DOM document.
 
Methods inherited from class org.opensaml.xml.encryption.Decrypter
checkAndMarshall, decryptData, decryptData, decryptDataToDOM, decryptDataToDOM, decryptDataToList, decryptDataToList, decryptKey, decryptKey, getEncryptedKeyResolver, getKEKResolver, getKEKResolverCriteria, getKeyResolver, setEncryptedKeyResolver, setKEKResolver, setKEKResolverCriteria, setKeyResolver, setKeyResolverCriteria, setKeyResolverCriteria
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Decrypter

public Decrypter(KeyInfoCredentialResolver newResolver,
                 KeyInfoCredentialResolver newKEKResolver,
                 EncryptedKeyResolver newEncKeyResolver)
Constructor.

Parameters:
newResolver - resolver for data encryption keys.
newKEKResolver - resolver for key encryption keys.
newEncKeyResolver - resolver for EncryptedKey elements
Method Detail

isRootInNewDocument

public boolean isRootInNewDocument()
Get the flag which indicates whether the DOM Element which backs a decrypted SAML object will be the root of a new DOM document. Defaults to false. See also Decrypter. This flag will be passed as-is to Decrypter.decryptData(org.opensaml.xml.encryption.EncryptedData, boolean).

Returns:
the current value of the flag for this decrypter instance

setRootInNewDocument

public void setRootInNewDocument(boolean flag)
Set the flag which indicates whether the DOM Element which backs a decrypted SAML object will be the root of a new DOM document. Defaults to false. See also Decrypter. This flag will be passed as-is to Decrypter.decryptData(org.opensaml.xml.encryption.EncryptedData, boolean).

Parameters:
flag - the current value of the flag for this decrypter instance

decrypt

public Assertion decrypt(EncryptedAssertion encryptedAssertion)
                  throws DecryptionException
Decrypt the specified EncryptedAssertion.

Parameters:
encryptedAssertion - the EncryptedAssertion to decrypt
Returns:
an Assertion
Throws:
DecryptionException - thrown when decryption generates an error

decrypt

public Attribute decrypt(EncryptedAttribute encryptedAttribute)
                  throws DecryptionException
Decrypt the specified EncryptedAttribute.

Parameters:
encryptedAttribute - the EncryptedAttribute to decrypt
Returns:
an Attribute
Throws:
DecryptionException - thrown when decryption generates an error

decrypt

public SAMLObject decrypt(EncryptedID encryptedID)
                   throws DecryptionException
Decrypt the specified EncryptedID. Note that an EncryptedID can contain a NameID, an Assertion or a BaseID. It is up to the caller to determine the type of the resulting SAMLObject.

Parameters:
encryptedID - the EncryptedID to decrypt
Returns:
an XMLObject
Throws:
DecryptionException - thrown when decryption generates an error

decrypt

public NewID decrypt(NewEncryptedID newEncryptedID)
              throws DecryptionException
Decrypt the specified NewEncryptedID.

Parameters:
newEncryptedID - the NewEncryptedID to decrypt
Returns:
a NewID
Throws:
DecryptionException - thrown when decryption generates an error