Class SimpleDecryptionTest
- java.lang.Object
-
- org.opensaml.core.testing.OpenSAMLInitBaseTestCase
-
- org.opensaml.core.testing.XMLObjectBaseTestCase
-
- org.opensaml.saml.saml2.encryption.tests.SimpleDecryptionTest
-
public class SimpleDecryptionTest extends XMLObjectBaseTestCase
Simple tests for SAML 2 decrypter, using a hardcoded key (so not testing complex encrypted key resolution, etc).
-
-
Field Summary
Fields Modifier and Type Field Description private DataEncryptionParametersencParamsprivate Encrypterencrypterprivate StringencURIprivate KeyInfoCredentialResolverkeyResolver-
Fields inherited from class org.opensaml.core.testing.XMLObjectBaseTestCase
builderFactory, marshallerFactory, parserPool, simpleXMLObjectQName, unmarshallerFactory
-
-
Constructor Summary
Constructors Constructor Description SimpleDecryptionTest()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private DocumentgetDOM(String filename)Parse the XML file and return the DOM Document.protected voidsetUp()voidtestEncryptedAssertion()Test decryption of an EncryptedAssertion.voidtestEncryptedAssertionAsID()Test decryption of an Assertion as an EncryptedID.voidtestEncryptedAttribute()Test decryption of an EncryptedAttribute.voidtestEncryptedNameID()Test decryption of an NameID as an EncryptedID.voidtestEncryptedNewID()Test decryption of an NewID as an NewEncryptedID.voidtestErrorInvalidDataDecryptionKey()Test error condition of invalid data decryption key.-
Methods inherited from class org.opensaml.core.testing.XMLObjectBaseTestCase
assertXMLEquals, assertXMLEquals, buildXMLObject, getBuilder, getMarshaller, getMarshaller, getUnmarshaller, getUnmarshaller, getUnmarshaller, initXMLObjectSupport, parseXMLDocument, printXML, printXML, unmarshallElement, unmarshallElement
-
Methods inherited from class org.opensaml.core.testing.OpenSAMLInitBaseTestCase
initOpenSAML
-
-
-
-
Field Detail
-
keyResolver
private KeyInfoCredentialResolver keyResolver
-
encURI
private String encURI
-
encParams
private DataEncryptionParameters encParams
-
encrypter
private Encrypter encrypter
-
-
Method Detail
-
testEncryptedAssertion
public void testEncryptedAssertion() throws XMLParserException, EncryptionExceptionTest decryption of an EncryptedAssertion.- Throws:
XMLParserException- thrown if there is an error parsing the control XML fileEncryptionException- thrown if there is an error encrypting the control XML
-
testEncryptedAssertionAsID
public void testEncryptedAssertionAsID() throws XMLParserException, EncryptionExceptionTest decryption of an Assertion as an EncryptedID.- Throws:
XMLParserException- thrown if there is an error parsing the control XML fileEncryptionException- thrown if there is an error encrypting the control XML
-
testEncryptedNameID
public void testEncryptedNameID() throws XMLParserException, EncryptionExceptionTest decryption of an NameID as an EncryptedID.- Throws:
XMLParserException- thrown if there is an error parsing the control XML fileEncryptionException- thrown if there is an error encrypting the control XML
-
testEncryptedNewID
public void testEncryptedNewID() throws XMLParserException, EncryptionExceptionTest decryption of an NewID as an NewEncryptedID.- Throws:
XMLParserException- thrown if there is an error parsing the control XML fileEncryptionException- thrown if there is an error encrypting the control XML
-
testEncryptedAttribute
public void testEncryptedAttribute() throws XMLParserException, EncryptionExceptionTest decryption of an EncryptedAttribute.- Throws:
XMLParserException- thrown if there is an error parsing the control XML fileEncryptionException- thrown if there is an error encrypting the control XML
-
testErrorInvalidDataDecryptionKey
public void testErrorInvalidDataDecryptionKey() throws XMLParserException, EncryptionException, NoSuchAlgorithmException, NoSuchProviderException, KeyExceptionTest error condition of invalid data decryption key.- Throws:
XMLParserException- thrown if there is an error parsing the control XML fileEncryptionException- thrown if there is an error encrypting the control XMLNoSuchProviderException- security provider was invalidNoSuchAlgorithmException- security/key algorithm was invalidKeyException- ...
-
getDOM
private Document getDOM(String filename) throws XMLParserException
Parse the XML file and return the DOM Document.- Parameters:
filename- file containing control XML- Returns:
- parsed Document
- Throws:
XMLParserException- if parser encounters an error
-
-