Class SimpleDecryptionTest
- java.lang.Object
-
- org.opensaml.core.OpenSAMLInitBaseTestCase
-
- org.opensaml.core.xml.XMLObjectBaseTestCase
-
- org.opensaml.xmlsec.encryption.support.SimpleDecryptionTest
-
public class SimpleDecryptionTest extends XMLObjectBaseTestCase
Simple tests for decryption.
-
-
Field Summary
Fields Modifier and Type Field Description private CredentialencCredprivate KeyencKeyprivate DataEncryptionParametersencParamsprivate EncryptedDataencryptedContentprivate EncryptedDataencryptedDataprivate EncryptedKeyencryptedKeyprivate StringencURIprivate CredentialkekCredprivate KeyEncryptionParameterskekParamsprivate KeyInfoCredentialResolverkekResolverprivate StringkekURIprivate KeyInfoCredentialResolverkeyResolverprivate SecurityProviderTestSupportproviderSupportprivate DocumenttargetDOMprivate StringtargetFileprivate SignableSimpleXMLObjecttargetObject-
Fields inherited from class org.opensaml.core.xml.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 protected voidsetUp()voidtestEncryptedContent()Test simple decryption of an EncryptedData object which is of type Content.voidtestEncryptedDataAlgorithmBlacklistFail()Test EncryptedData decryption which should fail due to blacklist validation.voidtestEncryptedDataAlgorithmWhitelistFail()Test EncryptedData decryption which should fail due to whitelist validation.voidtestEncryptedDataAlgorithmWhitelistPass()Test EncryptedData decryption which should pass the whitelist validation b/c the list specifies the algorithm in use.voidtestEncryptedElement()Test simple decryption of an EncryptedData object which is of type Element.voidtestEncryptedElementWithEncryptedKeyInline()Test decryption of an EncryptedData object which is of type Element, where the decryption key is found as an inline EncryptedKey within EncryptedData/KeyInfo.voidtestEncryptedKey()Test simple decryption of an EncryptedKey object.voidtestEncryptedKeyAlgorithmBlacklistFail()Test EncryptedKey decryption which should fail due to blacklist validation.voidtestEncryptedKeyAlgorithmWhitelistFail()Test EncryptedKey decryption which should fail due to whitelist validation.voidtestEncryptedKeyAlgorithmWhitelistPass()Test EncryptedKey decryption which should pass the whitelist validation b/c the list specifies the algorithms in use.voidtestEncryptedKeyDigestMethodBlacklistFail()Test EncryptedKey decryption which should fail due to whitelist validation.voidtestEncryptedKeyDigestMethodWhitelistFail()Test EncryptedKey decryption which should fail due to whitelist validation.voidtestEncryptedKeyMGFBlacklistFail()Test EncryptedKey decryption which should fail due to whitelist validation.voidtestEncryptedKeyMGFWhitelistFail()Test EncryptedKey decryption which should fail due to whitelist validation.voidtestErrorInvalidDataDecryptionKey()Test error condition of invalid data decryption key.voidtestErrorInvalidKeyDecryptionKey()Test error condition of invalid key decryption key.voidtestErrorNoResolvers()Test error condition of no resolvers configured.-
Methods inherited from class org.opensaml.core.xml.XMLObjectBaseTestCase
assertXMLEquals, assertXMLEquals, buildXMLObject, getBuilder, getMarshaller, getMarshaller, getUnmarshaller, getUnmarshaller, getUnmarshaller, initXMLObjectSupport, parseXMLDocument, printXML, printXML, unmarshallElement, unmarshallElement
-
Methods inherited from class org.opensaml.core.OpenSAMLInitBaseTestCase
initOpenSAML
-
-
-
-
Field Detail
-
keyResolver
private KeyInfoCredentialResolver keyResolver
-
kekResolver
private KeyInfoCredentialResolver kekResolver
-
encURI
private String encURI
-
encKey
private Key encKey
-
encParams
private DataEncryptionParameters encParams
-
encryptedData
private EncryptedData encryptedData
-
encryptedContent
private EncryptedData encryptedContent
-
encCred
private Credential encCred
-
kekURI
private String kekURI
-
kekParams
private KeyEncryptionParameters kekParams
-
encryptedKey
private EncryptedKey encryptedKey
-
kekCred
private Credential kekCred
-
targetFile
private String targetFile
-
targetDOM
private Document targetDOM
-
targetObject
private SignableSimpleXMLObject targetObject
-
providerSupport
private SecurityProviderTestSupport providerSupport
-
-
Method Detail
-
setUp
@BeforeMethod protected void setUp() throws Exception
- 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.
-
testEncryptedDataAlgorithmBlacklistFail
public void testEncryptedDataAlgorithmBlacklistFail() throws DecryptionExceptionTest EncryptedData decryption which should fail due to blacklist validation.- Throws:
DecryptionException- ...
-
testEncryptedDataAlgorithmWhitelistFail
public void testEncryptedDataAlgorithmWhitelistFail() throws DecryptionExceptionTest EncryptedData decryption which should fail due to whitelist validation.- Throws:
DecryptionException- ...
-
testEncryptedDataAlgorithmWhitelistPass
public void testEncryptedDataAlgorithmWhitelistPass() throws DecryptionExceptionTest EncryptedData decryption which should pass the whitelist validation b/c the list specifies the algorithm in use.- Throws:
DecryptionException- ...
-
testEncryptedKeyAlgorithmBlacklistFail
public void testEncryptedKeyAlgorithmBlacklistFail() throws DecryptionExceptionTest 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.
-
-