Class JoseVerifyResponse
- java.lang.Object
-
- com.authlete.common.dto.ApiResponse
-
- com.authlete.common.dto.JoseVerifyResponse
-
- All Implemented Interfaces:
Serializable
public class JoseVerifyResponse extends ApiResponse
Response from Authlete's/api/jose/verifyAPI.- Since:
- 2.23, Authlete 1.1.22
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description JoseVerifyResponse()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String[]getErrorDescriptions()Get the list of error messages.String[]getInvalidClaims()Get the list of invalid claims.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 themandatoryClaimsrequest parameter.booleanisSignatureValid()Get the result of the signature verification.booleanisValid()Get the result of the verification on the JOSE object.JoseVerifyResponsesetErrorDescriptions(String[] descriptions)Set the list of error messages.JoseVerifyResponsesetInvalidClaims(String[] claims)Set the list of invalid claims.JoseVerifyResponsesetMissingClaims(String[] claims)Set the list of missing claims.JoseVerifyResponsesetSignatureValid(boolean valid)Set the result of the signature verification.JoseVerifyResponsesetValid(boolean valid)Set the result of the verification on the JOSE object.-
Methods inherited from class com.authlete.common.dto.ApiResponse
getResponseHeaders, getResultCode, getResultMessage, setResponseHeaders, setResultCode, setResultMessage
-
-
-
-
Method Detail
-
isValid
public boolean isValid()
Get the result of the verification on the JOSE object.- Returns:
trueif the JOSE object passed to Authlete's/api/jose/verifyAPI is valid.
-
setValid
public JoseVerifyResponse setValid(boolean valid)
Set the result of the verification on the JOSE object.- Parameters:
valid-trueto indicate that the JOSE object passed to Authlete's/api/jose/verifyAPI is valid.- Returns:
thisobject.
-
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:
trueif the signature of the JOSE is valid.
-
setSignatureValid
public JoseVerifyResponse setSignatureValid(boolean valid)
Set the result of the signature verification.- Parameters:
valid-trueto indicate the signature of the JOSE is valid.- Returns:
thisobject.
-
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 themandatoryClaimsrequest parameter.For example, if the value of the
mandatoryClaimsparameter of the request was["exp", "iat"]and if the payload part of the JOSE object contains theexpclaim but does not contain theiatclaim, this method returns["iat"].Note that this method returns
nullif the payload part of the JOSE object could not be retrieved. For example, in the case that the value of thejoserequest 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:
thisobject.
-
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
expclaim 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:
thisobject.
-
getErrorDescriptions
public String[] getErrorDescriptions()
Get the list of error messages.When the JOSE object is valid (= when
isValid()method returnstrue), this method returnsnull.- Returns:
- List of error messages.
-
setErrorDescriptions
public JoseVerifyResponse setErrorDescriptions(String[] descriptions)
Set the list of error messages.- Parameters:
descriptions- List of error messages.- Returns:
thisobject.
-
-