Class SimpleDecryptionTest
java.lang.Object
org.opensaml.core.testing.OpenSAMLInitBaseTestCase
org.opensaml.core.testing.XMLObjectBaseTestCase
org.opensaml.xmlsec.encryption.support.tests.SimpleDecryptionTest
public class SimpleDecryptionTest
extends org.opensaml.core.testing.XMLObjectBaseTestCase
Simple tests for decryption.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Credentialprivate Keyprivate DataEncryptionParametersprivate EncryptedDataprivate EncryptedDataprivate EncryptedKeyprivate Stringprivate Credentialprivate KeyEncryptionParametersprivate KeyInfoCredentialResolverprivate Stringprivate KeyInfoCredentialResolverprivate org.opensaml.security.testing.SecurityProviderTestSupportprivate Documentprivate Stringprivate SignableSimpleXMLObjectFields inherited from class org.opensaml.core.testing.XMLObjectBaseTestCase
builderFactory, marshallerFactory, parserPool, simpleXMLObjectQName, unmarshallerFactory -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidsetUp()voidTest simple decryption of an EncryptedData object which is of type Content.voidTest EncryptedData decryption which should fail due to blacklist validation.voidTest EncryptedData decryption which should fail due to whitelist validation.voidTest EncryptedData decryption which should pass the whitelist validation b/c the list specifies the algorithm in use.voidTest EncryptedData decryption which should fail due to presence of CipherReference failing default pre-decryption validator.voidTest simple decryption of an EncryptedData object which is of type Element.voidTest decryption of an EncryptedData object which is of type Element, where the decryption key is found as an inline EncryptedKey within EncryptedData/KeyInfo.voidTest simple decryption of an EncryptedData object which is of type Element, with a null pre-decryption validator.voidTest simple decryption of an EncryptedKey object.voidTest EncryptedKey decryption which should fail due to blacklist validation.voidTest EncryptedKey decryption which should fail due to whitelist validation.voidTest EncryptedKey decryption which should pass the whitelist validation b/c the list specifies the algorithms in use.voidTest EncryptedKey decryption which should fail due to whitelist validation.voidTest EncryptedKey decryption which should fail due to whitelist validation.voidTest EncryptedKey decryption which should fail due to whitelist validation.voidTest EncryptedKey decryption which should fail due to whitelist validation.voidTest EncryptedData decryption which should fail due to presence of CipherReference failing default pre-decryption validator.voidTest simple decryption of an EncryptedKey object with a null pre-decryption validator.voidTest error condition of invalid data decryption key.voidTest error condition of invalid key decryption key.voidTest error condition of no resolvers configured.Methods inherited from class org.opensaml.core.testing.XMLObjectBaseTestCase
assertXMLEquals, assertXMLEquals, buildXMLObject, getBuilder, getMarshaller, getMarshaller, getUnmarshaller, getUnmarshaller, getUnmarshaller, initXMLObjectSupport, parseXMLDocument, printXML, printXML, unmarshallElement, unmarshallElementMethods inherited from class org.opensaml.core.testing.OpenSAMLInitBaseTestCase
initOpenSAML
-
Field Details
-
keyResolver
-
kekResolver
-
encURI
-
encKey
-
encParams
-
encryptedData
-
encryptedContent
-
encCred
-
kekURI
-
kekParams
-
encryptedKey
-
kekCred
-
targetFile
-
targetDOM
-
targetObject
-
providerSupport
private org.opensaml.security.testing.SecurityProviderTestSupport providerSupport
-
-
Constructor Details
-
SimpleDecryptionTest
public SimpleDecryptionTest()Constructor.
-
-
Method Details
-
setUp
- Throws:
Exception
-
testEncryptedKey
public void testEncryptedKey()Test simple decryption of an EncryptedKey object. -
testEncryptedElement
public void testEncryptedElement()Test simple decryption of an EncryptedData object which is of type Element. -
testEncryptedKeyWithNoPreValidator
public void testEncryptedKeyWithNoPreValidator()Test simple decryption of an EncryptedKey object with a null pre-decryption validator. -
testEncryptedElementWithNoPrevalidator
public void testEncryptedElementWithNoPrevalidator()Test simple decryption of an EncryptedData object which is of type Element, with a null pre-decryption validator. -
testEncryptedDataWithCipherReference
Test EncryptedData decryption which should fail due to presence of CipherReference failing default pre-decryption validator.- Throws:
DecryptionException
-
testEncryptedKeyWithCipherReference
Test EncryptedData decryption which should fail due to presence of CipherReference failing default pre-decryption validator.- Throws:
DecryptionException
-
testEncryptedDataAlgorithmBlacklistFail
Test EncryptedData decryption which should fail due to blacklist validation.- Throws:
DecryptionException- ...
-
testEncryptedDataAlgorithmWhitelistFail
Test EncryptedData decryption which should fail due to whitelist validation.- Throws:
DecryptionException- ...
-
testEncryptedDataAlgorithmWhitelistPass
Test EncryptedData decryption which should pass the whitelist validation b/c the list specifies the algorithm in use.- Throws:
DecryptionException- ...
-
testEncryptedKeyAlgorithmBlacklistFail
Test EncryptedKey decryption which should fail due to blacklist validation.- Throws:
DecryptionException- ...
-
testEncryptedKeyDigestMethodBlacklistFail
public void testEncryptedKeyDigestMethodBlacklistFail() throws DecryptionException, EncryptionException, XMLParserExceptionTest EncryptedKey decryption which should fail due to whitelist validation.- Throws:
DecryptionException- ...XMLParserException- ...EncryptionException- ...
-
testEncryptedKeyMGFBlacklistFail
public void testEncryptedKeyMGFBlacklistFail() throws DecryptionException, EncryptionException, XMLParserExceptionTest EncryptedKey decryption which should fail due to whitelist validation.- Throws:
DecryptionException- ...XMLParserException- ...EncryptionException- ...
-
testEncryptedKeyAlgorithmWhitelistFail
public void testEncryptedKeyAlgorithmWhitelistFail() throws DecryptionException, EncryptionException, XMLParserExceptionTest EncryptedKey decryption which should fail due to whitelist validation.- Throws:
DecryptionException- ...XMLParserException- ...EncryptionException- ...
-
testEncryptedKeyDigestMethodWhitelistFail
public void testEncryptedKeyDigestMethodWhitelistFail() throws DecryptionException, EncryptionException, XMLParserExceptionTest EncryptedKey decryption which should fail due to whitelist validation.- Throws:
DecryptionException- ...XMLParserException- ...EncryptionException- ...
-
testEncryptedKeyMGFWhitelistFail
public void testEncryptedKeyMGFWhitelistFail() throws DecryptionException, EncryptionException, XMLParserExceptionTest EncryptedKey decryption which should fail due to whitelist validation.- Throws:
DecryptionException- ...XMLParserException- ...EncryptionException- ...
-
testEncryptedKeyAlgorithmWhitelistPass
public void testEncryptedKeyAlgorithmWhitelistPass() throws DecryptionException, EncryptionException, XMLParserExceptionTest EncryptedKey decryption which should pass the whitelist validation b/c the list specifies the algorithms in use.- Throws:
DecryptionException- ...XMLParserException- ...EncryptionException- ...
-
testEncryptedElementWithEncryptedKeyInline
public void testEncryptedElementWithEncryptedKeyInline()Test decryption of an EncryptedData object which is of type Element, where the decryption key is found as an inline EncryptedKey within EncryptedData/KeyInfo. -
testErrorNoResolvers
public void testErrorNoResolvers()Test error condition of no resolvers configured. -
testErrorInvalidDataDecryptionKey
public void testErrorInvalidDataDecryptionKey() throws NoSuchAlgorithmException, NoSuchProviderException, KeyExceptionTest error condition of invalid data decryption key.- Throws:
NoSuchProviderException- ...NoSuchAlgorithmException- ...KeyException- ...
-
testErrorInvalidKeyDecryptionKey
public void testErrorInvalidKeyDecryptionKey() throws NoSuchAlgorithmException, NoSuchProviderExceptionTest error condition of invalid key decryption key.- Throws:
NoSuchProviderException- ...NoSuchAlgorithmException- ...
-
testEncryptedContent
public void testEncryptedContent()Test simple decryption of an EncryptedData object which is of type Content.
-