Enum Class JoseException.Reason
- All Implemented Interfaces:
Serializable, Comparable<JoseException.Reason>, Constable
- Enclosing class:
JoseException
Why a JOSE input was rejected. Each reason belongs to exactly one exception class and category, and has one fixed
message.
This enum is not switch-stable: a later release may add constants, so a switch over it needs a default
branch.
- Since:
- 1.0.0
- Author:
- Mark Allen
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe header'salgis not one of the allowed algorithms, compared exactly;nonein any case lands here.More than one trusted key fits the token: two usable keys share itskid, or, without akid, more than one key fits its algorithm.None of the token's audiences is an expected audience.The payload is not a strict UTF-8 JSON object within the limits, has duplicate members, is empty, or holds a registered claim of the wrong type or out of range, such as anexpthat is not a number or an emptyaudarray (RFC 7519 section 4.1).The header has azipmember.The token has acnfclaim (RFC 7800): it is bound to a key whose possession this validator does not check, so it is never accepted as a bearer token.The header has acritmember (RFC 7515 section 4.1.11).The token is a JWE compact serialization, with four dots (RFC 7516), which Revetsec does not decrypt.The token'sexphas passed, allowing for clock skew.The JOSE header is not a strict UTF-8 JSON object within the limits, has duplicate members, has no stringalg, or has akidthat is not a string of 1 to 256 characters.The header'stypis not one of the allowed types, or it is absent where a type is required.The token'siatis in the future, allowing for clock skew.The token'sissis not the expected issuer, compared exactly.The token starts with a left curly bracket, as a JWS JSON serialization does (RFC 7515 section 7.2), which Revetsec does not accept.Trusted keys with the token'skidexist, but none fits its algorithm: another key type or curve, anotheralg, or an RSA key withoutalgwhile more than one RSA algorithm is allowed.The key's JWKissuermember does not match the token'siss.The JSON Web Key Set document is not a strict JSON object with akeysarray of objects within the size and key-count limits (RFC 7517 section 5).A required claim is absent or JSONnull.The header has actymember, as a nested token does (RFC 7519 section 5.2).The token'snbfhas not yet been reached, allowing for clock skew.The signature has the wrong length for its algorithm or key, or an ECDSA signature's r or s is outside [1, n − 1].The signature did not verify.The token is not a JWS compact serialization: a character outside the base64url alphabet and., a number of dots other than two or four, an empty header, or a segment that is not canonical unpadded base64url (RFC 7515 sections 2 and 7.1).The token is longer than the validator's maximum token length.The header has ab64member (RFC 7797).No trusted key matches the token'skid, or, without akid, no trusted key fits its algorithm.The header carries its own key or a key location (jwk,jkuorx5u), which Revetsec never trusts or fetches. -
Method Summary
Modifier and TypeMethodDescriptionstatic JoseException.ReasonReturns the enum constant of this class with the specified name.static JoseException.Reason[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
TOKEN_TOO_LARGE
The token is longer than the validator's maximum token length. Nothing else about it was examined.MalformedJoseInputException. -
TOKEN_SYNTAX
The token is not a JWS compact serialization: a character outside the base64url alphabet and., a number of dots other than two or four, an empty header, or a segment that is not canonical unpadded base64url (RFC 7515 sections 2 and 7.1). Four dots areENCRYPTED_TOKEN, and a leading left curly bracket isJSON_SERIALIZATION.MalformedJoseInputException. -
HEADER
The JOSE header is not a strict UTF-8 JSON object within the limits, has duplicate members, has no stringalg, or has akidthat is not a string of 1 to 256 characters.MalformedJoseInputException. -
CLAIMS
The payload is not a strict UTF-8 JSON object within the limits, has duplicate members, is empty, or holds a registered claim of the wrong type or out of range, such as anexpthat is not a number or an emptyaudarray (RFC 7519 section 4.1).MalformedJoseInputException. -
KEY_SET
The JSON Web Key Set document is not a strict JSON object with akeysarray of objects within the size and key-count limits (RFC 7517 section 5).MalformedJoseInputException. -
ENCRYPTED_TOKEN
The token is a JWE compact serialization, with four dots (RFC 7516), which Revetsec does not decrypt.UnsupportedJoseFeatureException. -
JSON_SERIALIZATION
The token starts with a left curly bracket, as a JWS JSON serialization does (RFC 7515 section 7.2), which Revetsec does not accept.UnsupportedJoseFeatureException. -
CRITICAL_HEADER
The header has acritmember (RFC 7515 section 4.1.11). Revetsec understands no extension, so it rejects every critical one.UnsupportedJoseFeatureException. -
UNENCODED_PAYLOAD
The header has ab64member (RFC 7797).UnsupportedJoseFeatureException. -
COMPRESSED_PAYLOAD
The header has azipmember.UnsupportedJoseFeatureException. -
NESTED_TOKEN
The header has actymember, as a nested token does (RFC 7519 section 5.2).UnsupportedJoseFeatureException. -
ALGORITHM_NOT_ALLOWED
The header'salgis not one of the allowed algorithms, compared exactly;nonein any case lands here.JwtValidationException. -
UNTRUSTED_KEY_REFERENCE
The header carries its own key or a key location (jwk,jkuorx5u), which Revetsec never trusts or fetches.JwtValidationException. -
SIGNATURE_MALFORMED
The signature has the wrong length for its algorithm or key, or an ECDSA signature's r or s is outside [1, n − 1]. Decided before any cryptographic verification and, for the key-independent part, before any key is looked up.JwtValidationException. -
UNKNOWN_KEY
No trusted key matches the token'skid, or, without akid, no trusted key fits its algorithm.JwtValidationException. -
AMBIGUOUS_KEY
More than one trusted key fits the token: two usable keys share itskid, or, without akid, more than one key fits its algorithm.JwtValidationException. -
KEY_ALGORITHM_MISMATCH
Trusted keys with the token'skidexist, but none fits its algorithm: another key type or curve, anotheralg, or an RSA key withoutalgwhile more than one RSA algorithm is allowed.JwtValidationException. -
KEY_ISSUER_MISMATCH
-
SIGNATURE_MISMATCH
The signature did not verify.JwtValidationException. -
INVALID_TYPE
The header'stypis not one of the allowed types, or it is absent where a type is required.JwtValidationException. -
ISSUER_MISMATCH
The token'sissis not the expected issuer, compared exactly.JwtValidationException. -
AUDIENCE_MISMATCH
None of the token's audiences is an expected audience.JwtValidationException. -
MISSING_CLAIM
A required claim is absent or JSONnull.JwtValidationException. -
EXPIRED
The token'sexphas passed, allowing for clock skew.JwtValidationException. -
NOT_YET_VALID
The token'snbfhas not yet been reached, allowing for clock skew.JwtValidationException. -
ISSUED_IN_FUTURE
The token'siatis in the future, allowing for clock skew.JwtValidationException. -
CONFIRMATION_NOT_VERIFIED
The token has acnfclaim (RFC 7800): it is bound to a key whose possession this validator does not check, so it is never accepted as a bearer token.JwtValidationException.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-