Class JoseVerifyResponse

  • All Implemented Interfaces:
    Serializable

    public class JoseVerifyResponse
    extends ApiResponse
    Response from Authlete's /api/jose/verify API.
    Since:
    2.23, Authlete 1.1.22
    See Also:
    Serialized Form
    • Constructor Detail

      • JoseVerifyResponse

        public JoseVerifyResponse()
    • Method Detail

      • isValid

        public boolean isValid()
        Get the result of the verification on the JOSE object.
        Returns:
        true if the JOSE object passed to Authlete's /api/jose/verify API is valid.
      • setValid

        public JoseVerifyResponse setValid​(boolean valid)
        Set the result of the verification on the JOSE object.
        Parameters:
        valid - true to indicate that the JOSE object passed to Authlete's /api/jose/verify API is valid.
        Returns:
        this object.
      • isSignatureValid

        public boolean isSignatureValid()
        Get the result of the signature verification.

        If the given JOSE object is signed and its signature has been successfully verified, this method returns true.

        Returns:
        true if the signature of the JOSE is valid.
      • setSignatureValid

        public JoseVerifyResponse setSignatureValid​(boolean valid)
        Set the result of the signature verification.
        Parameters:
        valid - true to indicate the signature of the JOSE is valid.
        Returns:
        this object.
      • getMissingClaims

        public String[] getMissingClaims()
        Get the list of missing claims; the claims that are not included in the payload part of the JOSE object although they are listed in the mandatoryClaims request parameter.

        For example, if the value of the mandatoryClaims parameter of the request was ["exp", "iat"] and if the payload part of the JOSE object contains the exp claim but does not contain the iat claim, this method returns ["iat"].

        Note that this method returns null if the payload part of the JOSE object could not be retrieved. For example, in the case that the value of the jose request parameter could not be parsed as JOSE.

        Returns:
        Missing claims.
      • setMissingClaims

        public JoseVerifyResponse setMissingClaims​(String[] claims)
        Set the list of missing claims.
        Parameters:
        claims - Missing claims.
        Returns:
        this object.
      • getInvalidClaims

        public String[] getInvalidClaims()
        Get the list of invalid claims.

        For example, if the payload of the JOSE object can be parsed as JSON and the JSON has an exp claim and if the value of the claim indicates that the JOSE object has expired, "exp" will be included in the list of invalid claims returned from this method.

        Returns:
        Invalid claims.
      • setInvalidClaims

        public JoseVerifyResponse setInvalidClaims​(String[] claims)
        Set the list of invalid claims.
        Parameters:
        claims - Invalid claims.
        Returns:
        this object.
      • getErrorDescriptions

        public String[] getErrorDescriptions()
        Get the list of error messages.

        When the JOSE object is valid (= when isValid() method returns true), this method returns null.

        Returns:
        List of error messages.
      • setErrorDescriptions

        public JoseVerifyResponse setErrorDescriptions​(String[] descriptions)
        Set the list of error messages.
        Parameters:
        descriptions - List of error messages.
        Returns:
        this object.