Class DefaultClientSecretCredential

    • Field Detail

      • DEFAULT_SECRET_KEY_NAME

        @Nonnull
        private static final String DEFAULT_SECRET_KEY_NAME
        Default client_secret keyname.
        See Also:
        Constant Field Values
      • clientSecret

        @Nonnull
        private final byte[] clientSecret
        The client_secret.
      • secretKeyName

        @Nonnull
        @NotEmpty
        private final String secretKeyName
        The chosen client_secret keyname.
    • Constructor Detail

      • DefaultClientSecretCredential

        public DefaultClientSecretCredential​(@Nonnull
                                             String secret)
        Constructor.
        Parameters:
        secret - the client_secret
      • DefaultClientSecretCredential

        public DefaultClientSecretCredential​(@Nonnull
                                             String secret,
                                             @Nonnull
                                             String keyName)
        Constructor.
        Parameters:
        secret - the client_secret
        keyName - the keyname to use when creating a JWKCredential
    • Method Detail

      • toEncryptionCredential

        public JWKCredential toEncryptionCredential​(com.nimbusds.jose.JWEAlgorithm alg,
                                                    com.nimbusds.jose.EncryptionMethod enc)
                                             throws com.nimbusds.jose.JOSEException
        Description copied from interface: ClientSecretCredential
        Create a symmetric encryption key derived from the client_secret and compatible with the key management mode and encryption algorithm specified.
        Specified by:
        toEncryptionCredential in interface ClientSecretCredential
        Parameters:
        alg - the key management mode
        enc - the encryption algorithm
        Returns:
        a JWKCredential compatible with the 'alg' and 'enc' input
        Throws:
        com.nimbusds.jose.JOSEException - if a key can not be derived