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/verify
API.- 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 themandatoryClaims
request parameter.boolean
isSignatureValid()
Get the result of the signature verification.boolean
isValid()
Get the result of the verification on the JOSE object.JoseVerifyResponse
setErrorDescriptions(String[] descriptions)
Set the list of error messages.JoseVerifyResponse
setInvalidClaims(String[] claims)
Set the list of invalid claims.JoseVerifyResponse
setMissingClaims(String[] claims)
Set the list of missing claims.JoseVerifyResponse
setSignatureValid(boolean valid)
Set the result of the signature verification.JoseVerifyResponse
setValid(boolean valid)
Set the result of the verification on the JOSE object.-
Methods inherited from class com.authlete.common.dto.ApiResponse
getResultCode, getResultMessage, setResultCode, setResultMessage
-
-
-
-
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 themandatoryClaims
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 theexp
claim but does not contain theiat
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 thejose
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 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:
this
object.
-
-