Class SimpleDecryptionTest
- java.lang.Object
-
- org.opensaml.core.OpenSAMLInitBaseTestCase
-
- org.opensaml.core.xml.XMLObjectBaseTestCase
-
- org.opensaml.xmlsec.encryption.support.SimpleDecryptionTest
-
public class SimpleDecryptionTest extends org.opensaml.core.xml.XMLObjectBaseTestCaseSimple tests for decryption.
-
-
Field Summary
Fields Modifier and Type Field Description private org.opensaml.security.credential.CredentialencCredprivate KeyencKeyprivate org.opensaml.xmlsec.encryption.support.DataEncryptionParametersencParamsprivate org.opensaml.xmlsec.encryption.EncryptedDataencryptedContentprivate org.opensaml.xmlsec.encryption.EncryptedDataencryptedDataprivate org.opensaml.xmlsec.encryption.EncryptedKeyencryptedKeyprivate StringencURIprivate org.opensaml.security.credential.CredentialkekCredprivate org.opensaml.xmlsec.encryption.support.KeyEncryptionParameterskekParamsprivate org.opensaml.xmlsec.keyinfo.KeyInfoCredentialResolverkekResolverprivate StringkekURIprivate org.opensaml.xmlsec.keyinfo.KeyInfoCredentialResolverkeyResolverprivate org.opensaml.security.SecurityProviderTestSupportproviderSupportprivate DocumenttargetDOMprivate StringtargetFileprivate SignableSimpleXMLObjecttargetObject
-
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
-
-
-
-
Field Detail
-
keyResolver
private org.opensaml.xmlsec.keyinfo.KeyInfoCredentialResolver keyResolver
-
kekResolver
private org.opensaml.xmlsec.keyinfo.KeyInfoCredentialResolver kekResolver
-
encURI
private String encURI
-
encKey
private Key encKey
-
encParams
private org.opensaml.xmlsec.encryption.support.DataEncryptionParameters encParams
-
encryptedData
private org.opensaml.xmlsec.encryption.EncryptedData encryptedData
-
encryptedContent
private org.opensaml.xmlsec.encryption.EncryptedData encryptedContent
-
encCred
private org.opensaml.security.credential.Credential encCred
-
kekURI
private String kekURI
-
kekParams
private org.opensaml.xmlsec.encryption.support.KeyEncryptionParameters kekParams
-
encryptedKey
private org.opensaml.xmlsec.encryption.EncryptedKey encryptedKey
-
kekCred
private org.opensaml.security.credential.Credential kekCred
-
targetFile
private String targetFile
-
targetDOM
private Document targetDOM
-
targetObject
private SignableSimpleXMLObject targetObject
-
providerSupport
private org.opensaml.security.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 org.opensaml.xmlsec.encryption.support.DecryptionExceptionTest EncryptedData decryption which should fail due to blacklist validation.- Throws:
org.opensaml.xmlsec.encryption.support.DecryptionException- ...
-
testEncryptedDataAlgorithmWhitelistFail
public void testEncryptedDataAlgorithmWhitelistFail() throws org.opensaml.xmlsec.encryption.support.DecryptionExceptionTest EncryptedData decryption which should fail due to whitelist validation.- Throws:
org.opensaml.xmlsec.encryption.support.DecryptionException- ...
-
testEncryptedDataAlgorithmWhitelistPass
public void testEncryptedDataAlgorithmWhitelistPass() throws org.opensaml.xmlsec.encryption.support.DecryptionExceptionTest EncryptedData decryption which should pass the whitelist validation b/c the list specifies the algorithm in use.- Throws:
org.opensaml.xmlsec.encryption.support.DecryptionException- ...
-
testEncryptedKeyAlgorithmBlacklistFail
public void testEncryptedKeyAlgorithmBlacklistFail() throws org.opensaml.xmlsec.encryption.support.DecryptionExceptionTest EncryptedKey decryption which should fail due to blacklist validation.- Throws:
org.opensaml.xmlsec.encryption.support.DecryptionException- ...
-
testEncryptedKeyDigestMethodBlacklistFail
public void testEncryptedKeyDigestMethodBlacklistFail() throws org.opensaml.xmlsec.encryption.support.DecryptionException, org.opensaml.xmlsec.encryption.support.EncryptionException, net.shibboleth.utilities.java.support.xml.XMLParserExceptionTest EncryptedKey decryption which should fail due to whitelist validation.- Throws:
org.opensaml.xmlsec.encryption.support.DecryptionException- ...net.shibboleth.utilities.java.support.xml.XMLParserException- ...org.opensaml.xmlsec.encryption.support.EncryptionException- ...
-
testEncryptedKeyMGFBlacklistFail
public void testEncryptedKeyMGFBlacklistFail() throws org.opensaml.xmlsec.encryption.support.DecryptionException, org.opensaml.xmlsec.encryption.support.EncryptionException, net.shibboleth.utilities.java.support.xml.XMLParserExceptionTest EncryptedKey decryption which should fail due to whitelist validation.- Throws:
org.opensaml.xmlsec.encryption.support.DecryptionException- ...net.shibboleth.utilities.java.support.xml.XMLParserException- ...org.opensaml.xmlsec.encryption.support.EncryptionException- ...
-
testEncryptedKeyAlgorithmWhitelistFail
public void testEncryptedKeyAlgorithmWhitelistFail() throws org.opensaml.xmlsec.encryption.support.DecryptionException, org.opensaml.xmlsec.encryption.support.EncryptionException, net.shibboleth.utilities.java.support.xml.XMLParserExceptionTest EncryptedKey decryption which should fail due to whitelist validation.- Throws:
org.opensaml.xmlsec.encryption.support.DecryptionException- ...net.shibboleth.utilities.java.support.xml.XMLParserException- ...org.opensaml.xmlsec.encryption.support.EncryptionException- ...
-
testEncryptedKeyDigestMethodWhitelistFail
public void testEncryptedKeyDigestMethodWhitelistFail() throws org.opensaml.xmlsec.encryption.support.DecryptionException, org.opensaml.xmlsec.encryption.support.EncryptionException, net.shibboleth.utilities.java.support.xml.XMLParserExceptionTest EncryptedKey decryption which should fail due to whitelist validation.- Throws:
org.opensaml.xmlsec.encryption.support.DecryptionException- ...net.shibboleth.utilities.java.support.xml.XMLParserException- ...org.opensaml.xmlsec.encryption.support.EncryptionException- ...
-
testEncryptedKeyMGFWhitelistFail
public void testEncryptedKeyMGFWhitelistFail() throws org.opensaml.xmlsec.encryption.support.DecryptionException, org.opensaml.xmlsec.encryption.support.EncryptionException, net.shibboleth.utilities.java.support.xml.XMLParserExceptionTest EncryptedKey decryption which should fail due to whitelist validation.- Throws:
org.opensaml.xmlsec.encryption.support.DecryptionException- ...net.shibboleth.utilities.java.support.xml.XMLParserException- ...org.opensaml.xmlsec.encryption.support.EncryptionException- ...
-
testEncryptedKeyAlgorithmWhitelistPass
public void testEncryptedKeyAlgorithmWhitelistPass() throws org.opensaml.xmlsec.encryption.support.DecryptionException, org.opensaml.xmlsec.encryption.support.EncryptionException, net.shibboleth.utilities.java.support.xml.XMLParserExceptionTest EncryptedKey decryption which should pass the whitelist validation b/c the list specifies the algorithms in use.- Throws:
org.opensaml.xmlsec.encryption.support.DecryptionException- ...net.shibboleth.utilities.java.support.xml.XMLParserException- ...org.opensaml.xmlsec.encryption.support.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.
-
-