Class IssuedEncryptedJWTTest

  • All Implemented Interfaces:
    Aware, ApplicationContextAware, org.testng.IHookable, org.testng.ITestNGListener
    Direct Known Subclasses:
    RequestObjectJWETest

    public class IssuedEncryptedJWTTest
    extends AbstractIssuedJWTSecurityTest
    Tests for verifying that the JWT encryption issued by OP matches the expected configuration. OP may issue JWTs from authorize, token and userinfo endpoints, depending on the RP or resource metadata.
    • Field Detail

      • JWS_ALGORITHMS

        protected static final List<com.nimbusds.jose.JWSAlgorithm> JWS_ALGORITHMS
        Enabled JWS algorithms to be iterated over in the tests.
      • JWE_ALGORITHMS

        protected static final List<com.nimbusds.jose.JWEAlgorithm> JWE_ALGORITHMS
        Enabled JWE algorithms to be iterated over in the tests.
      • ENCRYPTION_METHODS

        protected static final List<com.nimbusds.jose.EncryptionMethod> ENCRYPTION_METHODS
        Enabled encryption methods to be iterated over in the tests.
      • testSignedJwt

        protected final boolean testSignedJwt
    • Method Detail

      • testJwtEncryption_noSigAlgNorEncSpecified

        public void testJwtEncryption_noSigAlgNorEncSpecified()
                                                       throws Exception
        Throws:
        Exception
      • getSignatureVerificationKey

        protected static PublicKey getSignatureVerificationKey​(com.nimbusds.jose.JWSAlgorithm jwsAlgorithm)
      • getSigningKey

        protected static PrivateKey getSigningKey​(com.nimbusds.jose.JWSAlgorithm jwsAlgorithm)
      • assertSecretBasedEncryption

        protected void assertSecretBasedEncryption​(com.nimbusds.jose.JWEAlgorithm jweAlgorithm,
                                                   com.nimbusds.jose.EncryptionMethod method)
      • testJwtEncryption_a128kwWithEnabledMethods

        public void testJwtEncryption_a128kwWithEnabledMethods()
                                                        throws Exception
        Throws:
        Exception
      • testJwtEncryption_a128kwWithExcludedMethod

        public void testJwtEncryption_a128kwWithExcludedMethod()
                                                        throws Exception
        Throws:
        Exception
      • testJwtEncryption_a192kwWithEnabledMethods

        public void testJwtEncryption_a192kwWithEnabledMethods()
                                                        throws Exception
        Throws:
        Exception
      • testJwtEncryption_a192kwWithExcludedMethod

        public void testJwtEncryption_a192kwWithExcludedMethod()
                                                        throws Exception
        Throws:
        Exception
      • testJwtEncryption_a256kwWithEnabledMethods

        public void testJwtEncryption_a256kwWithEnabledMethods()
                                                        throws Exception
        Throws:
        Exception
      • testJwtEncryption_a256kwWithExcludedMethod

        public void testJwtEncryption_a256kwWithExcludedMethod()
                                                        throws Exception
        Throws:
        Exception
      • testJwtEncryption_a128gcmkwWithEnabledMethods

        public void testJwtEncryption_a128gcmkwWithEnabledMethods()
                                                           throws Exception
        Throws:
        Exception
      • testJwtEncryption_a128gcmkwWithExcludedMethod

        public void testJwtEncryption_a128gcmkwWithExcludedMethod()
                                                           throws Exception
        Throws:
        Exception
      • testJwtEncryption_a192gcmkwWithEnabledMethods

        public void testJwtEncryption_a192gcmkwWithEnabledMethods()
                                                           throws Exception
        Throws:
        Exception
      • testJwtEncryption_a192gcmkwWithExcludedMethod

        public void testJwtEncryption_a192gcmkwWithExcludedMethod()
                                                           throws Exception
        Throws:
        Exception
      • testJwtEncryption_a256gcmkwWithEnabledMethods

        public void testJwtEncryption_a256gcmkwWithEnabledMethods()
                                                           throws Exception
        Throws:
        Exception
      • testJwtEncryption_a256gcmkwWithExcludedMethod

        public void testJwtEncryption_a256gcmkwWithExcludedMethod()
                                                           throws Exception
        Throws:
        Exception
      • assertNoSymmetricKeyResponse

        protected void assertNoSymmetricKeyResponse​(com.nimbusds.jose.JWEAlgorithm jweAlgorithm,
                                                    com.nimbusds.jose.EncryptionMethod method)
                                             throws Exception
        Throws:
        Exception
      • testJwtEncryption_symmetricKeyEncryption_noKey

        public void testJwtEncryption_symmetricKeyEncryption_noKey()
                                                            throws Exception
        Throws:
        Exception
      • assertPublicKeyBasedEncryption

        protected void assertPublicKeyBasedEncryption​(PublicKey publicKey,
                                                      PrivateKey privateKey,
                                                      com.nimbusds.jose.JWEAlgorithm jweAlgorithm,
                                                      com.nimbusds.jose.EncryptionMethod method)
      • testJwtEncryption_ecdhWithEnabledMethods

        public void testJwtEncryption_ecdhWithEnabledMethods()
                                                      throws Exception
        Throws:
        Exception
      • testJwtEncryption_ecdhWithExcludedMethod

        public void testJwtEncryption_ecdhWithExcludedMethod()
                                                      throws Exception
        Throws:
        Exception
      • testJwtEncryption_ecdh128kwWithEnabledMethods

        public void testJwtEncryption_ecdh128kwWithEnabledMethods()
                                                           throws Exception
        Throws:
        Exception
      • testJwtEncryption_ecdh128kwWithExcludedMethod

        public void testJwtEncryption_ecdh128kwWithExcludedMethod()
                                                           throws Exception
        Throws:
        Exception
      • testJwtEncryption_ecdh192kwWithEnabledMethods

        public void testJwtEncryption_ecdh192kwWithEnabledMethods()
                                                           throws Exception
        Throws:
        Exception
      • testJwtEncryption_ecdh192kwWithExcludedMethod

        public void testJwtEncryption_ecdh192kwWithExcludedMethod()
                                                           throws Exception
        Throws:
        Exception
      • testJwtEncryption_ecdh256kwWithEnabledMethods

        public void testJwtEncryption_ecdh256kwWithEnabledMethods()
                                                           throws Exception
        Throws:
        Exception
      • testJwtEncryption_ecdh256kwWithExcludedMethod

        public void testJwtEncryption_ecdh256kwWithExcludedMethod()
                                                           throws Exception
        Throws:
        Exception
      • testJwtEncryption_rsa15WithEnabledMethods

        public void testJwtEncryption_rsa15WithEnabledMethods()
                                                       throws Exception
        Throws:
        Exception
      • testJwtEncryption_rsa15WithExcludedMethod

        public void testJwtEncryption_rsa15WithExcludedMethod()
                                                       throws Exception
        Throws:
        Exception
      • testJwtEncryption_rsaOaepWithEnabledMethods

        public void testJwtEncryption_rsaOaepWithEnabledMethods()
                                                         throws Exception
        Throws:
        Exception
      • testJwtEncryption_rsaOaepWithExcludedMethod

        public void testJwtEncryption_rsaOaepWithExcludedMethod()
                                                         throws Exception
        Throws:
        Exception
      • testJwtEncryption_rsaOaep256WithEnabledMethods

        public void testJwtEncryption_rsaOaep256WithEnabledMethods()
                                                            throws Exception
        Throws:
        Exception
      • testJwtEncryption_rsaOaep256WithExcludedMethod

        public void testJwtEncryption_rsaOaep256WithExcludedMethod()
                                                            throws Exception
        Throws:
        Exception
      • testJwtEncryption_rsaOaep384WithEnabledMethods

        public void testJwtEncryption_rsaOaep384WithEnabledMethods()
                                                            throws Exception
        Throws:
        Exception
      • testJwtEncryption_rsaOaep384WithExcludedMethod

        public void testJwtEncryption_rsaOaep384WithExcludedMethod()
                                                            throws Exception
        Throws:
        Exception
      • testJwtEncryption_rsaOaep512WithEnabledMethods

        public void testJwtEncryption_rsaOaep512WithEnabledMethods()
                                                            throws Exception
        Throws:
        Exception
      • testJwtEncryption_rsaOaep512WithExcludedMethod

        public void testJwtEncryption_rsaOaep512WithExcludedMethod()
                                                            throws Exception
        Throws:
        Exception
      • assertExcludedAlgorithm

        protected void assertExcludedAlgorithm​(com.nimbusds.jose.JWEAlgorithm jweAlgorithm,
                                               com.nimbusds.jose.EncryptionMethod method)
                                        throws Exception
        Throws:
        Exception
      • assertNoPublicKeyResponse

        protected void assertNoPublicKeyResponse​(com.nimbusds.jose.JWEAlgorithm jweAlgorithm,
                                                 com.nimbusds.jose.EncryptionMethod method)
                                          throws Exception
        Throws:
        Exception
      • testJwtEncryption_publicKeyEncryption_noKey

        public void testJwtEncryption_publicKeyEncryption_noKey()
                                                         throws Exception
        Throws:
        Exception