Class CodeHash

    • Constructor Detail

      • CodeHash

        public CodeHash​(String value)
        Creates a new authorisation code hash with the specified value.
        Parameters:
        value - The authorisation code hash value. Must not be null.
    • Method Detail

      • isRequiredInIDTokenClaims

        public static boolean isRequiredInIDTokenClaims​(ResponseType responseType)
        Checks if an authorisation code hash claim must be included in ID tokens for the specified response type.
        Parameters:
        responseType - The he OpenID Connect response type. Must not be null.
        Returns:
        true if the code hash is required, else false.
      • compute

        @Deprecated
        public static CodeHash compute​(AuthorizationCode code,
                                       com.nimbusds.jose.JWSAlgorithm alg)
        Computes the hash for the specified authorisation code and reference JSON Web Signature (JWS) algorithm.
        Parameters:
        code - The authorisation code. Must not be null.
        alg - The reference JWS algorithm. Must not be null.
        Returns:
        The authorisation code hash, or null if the JWS algorithm is not supported.
      • compute

        public static CodeHash compute​(AuthorizationCode code,
                                       com.nimbusds.jose.JWSAlgorithm alg,
                                       com.nimbusds.jose.jwk.Curve crv)
        Computes the hash for the specified authorisation code and reference JSON Web Signature (JWS) algorithm.
        Parameters:
        code - The authorisation code. Must not be null.
        alg - The reference JWS algorithm. Must not be null.
        crv - The JWK curve used with the JWS algorithm, null if not applicable.
        Returns:
        The authorisation code hash, or null if the JWS algorithm is not supported.