Class SecretSignature

    • Method Detail

      • supports

        public boolean supports​(com.nimbusds.jose.JWSAlgorithm algorithm)
        Description copied from interface: SignatureConfiguration
        Whether this signature configuration supports this algorithm.
        Specified by:
        supports in interface SignatureConfiguration
        Parameters:
        algorithm - the signature algorithm
        Returns:
        whether this signature configuration supports this algorithm
      • sign

        public com.nimbusds.jwt.SignedJWT sign​(com.nimbusds.jwt.JWTClaimsSet claims)
                                        throws com.nimbusds.jose.JOSEException
        Description copied from interface: SignatureGeneratorConfiguration
        Generate a signed JWT based on claims.
        Specified by:
        sign in interface SignatureGeneratorConfiguration
        Parameters:
        claims - the provided claims
        Returns:
        the signed JWT
        Throws:
        com.nimbusds.jose.JOSEException - could be thrown while signing the JWT token
      • verify

        public boolean verify​(com.nimbusds.jwt.SignedJWT jwt)
                       throws com.nimbusds.jose.JOSEException
        Description copied from interface: SignatureConfiguration
        Verify a signed JWT.
        Specified by:
        verify in interface SignatureConfiguration
        Parameters:
        jwt - the signed JWT
        Returns:
        whether the signed JWT is verified
        Throws:
        com.nimbusds.jose.JOSEException - exception when verifying the JWT
      • getSecret

        public java.lang.String getSecret()
        Returns:
        a string build the secret byte[] and UTF_8 charset
      • setSecret

        public void setSecret​(java.lang.String secret)
        Sets secret byte[] with a string with UTF_8 charset.
        Parameters:
        secret - UTF_8 string