Class SimpleDecryptionTest


  • public class SimpleDecryptionTest
    extends org.opensaml.core.xml.XMLObjectBaseTestCase
    Simple tests for decryption.
    • 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
      • providerSupport

        private org.opensaml.security.SecurityProviderTestSupport providerSupport
    • Constructor Detail

      • SimpleDecryptionTest

        public SimpleDecryptionTest()
        Constructor.
    • Method Detail

      • 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.DecryptionException
        Test 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.DecryptionException
        Test 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.DecryptionException
        Test 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.DecryptionException
        Test 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.XMLParserException
        Test 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.XMLParserException
        Test 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.XMLParserException
        Test 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.XMLParserException
        Test 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.XMLParserException
        Test 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.XMLParserException
        Test 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.
      • testEncryptedContent

        public void testEncryptedContent()
        Test simple decryption of an EncryptedData object which is of type Content.