Enum Class JwkSkipReason
- All Implemented Interfaces:
Serializable, Comparable<JwkSkipReason>, Constable
Why a key in a JSON Web Key Set is not used.
A key that fails any rule is skipped, never used for part of what it holds, and it never makes the whole set fail (RFC 7517 section 5). Only the document's structure or size does that. The checks run in a fixed order, and the first one that fails names the reason:
ktyis missing or not a string:MALFORMED_KEY;ktyis notRSA,ECorOKP:SYMMETRIC_KEYforoct, otherwiseUNSUPPORTED_KEY_TYPE;- a private or symmetric member (
d,p,q,dp,dq,qi,othork) is present:PRIVATE_KEY_MEMBERS; useorkey_opsdoes not allow verification:NOT_A_VERIFICATION_KEY;algis not aJwsAlgorithm, or names another key type or curve:UNSUPPORTED_ALGORITHMorALGORITHM_MISMATCH;crvnames an unsupported curve:UNSUPPORTED_CURVE;- a member is missing, of the wrong type or not canonically encoded:
MALFORMED_KEY; - the RSA modulus size is out of range:
RSA_KEY_SIZE; - the RSA public exponent is out of range:
RSA_EXPONENT; - the EC point is not on its curve:
EC_POINT_NOT_ON_CURVE; - the key is known to be weak:
WEAK_KEY; x5cdoes not hold the same key:CERTIFICATE_MISMATCH.
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 key'salgnames an algorithm for another key type or curve, such asES384on a P-256 key or any HMAC algorithm.The key'sx5cis not an array whose first element is a certificate in standard base64 that parses strictly, or that certificate holds a different key.An EC coordinate is not below the field prime, or the point is not on the curve.A member is missing, has the wrong JSON type or is not canonically encoded:ktymissing or not a string; a required key member (nande,crvwithxandy, orcrvwithx) missing, not a string or not canonical base64url; an RSA integer with a leading zero octet or an even modulus; an EC coordinate of the wrong length; an Ed25519xthat is not 32 octets or does not decode to a curve point (RFC 8032 section 5.1.3); akidthat is not a string of 1 to 256 characters; or anissuermember that is present but not a non-empty string.The key is not for verifying signatures: itsuseis notsig, itskey_opsis not an array of strings that containsverify, or the two members disagree (RFC 7517 sections 4.2 and 4.3).The key holds a private or symmetric member (d,p,q,dp,dq,qi,othork), so the set publishes key material it should not.The RSA public exponent is even, below 65537 or at least 232.The RSA modulus is shorter than 2048 or longer than 16384 bits.The key is symmetric (ktyoct).The key's curve (crv) is not P-256, P-384 or P-521 for anECkey, or not Ed25519 for anOKPkey.The key type (kty) is notRSA,EC,OKPoroct.The key is well formed but known to be weak: an RSA modulus with the ROCA fingerprint (CVE-2017-15361), or an Ed25519 point of small order. -
Method Summary
Modifier and TypeMethodDescriptionstatic JwkSkipReasonReturns the enum constant of this class with the specified name.static JwkSkipReason[]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
-
MALFORMED_KEY
A member is missing, has the wrong JSON type or is not canonically encoded:ktymissing or not a string; a required key member (nande,crvwithxandy, orcrvwithx) missing, not a string or not canonical base64url; an RSA integer with a leading zero octet or an even modulus; an EC coordinate of the wrong length; an Ed25519xthat is not 32 octets or does not decode to a curve point (RFC 8032 section 5.1.3); akidthat is not a string of 1 to 256 characters; or anissuermember that is present but not a non-empty string. -
UNSUPPORTED_KEY_TYPE
The key type (kty) is notRSA,EC,OKPoroct. -
SYMMETRIC_KEY
The key is symmetric (ktyoct). Revetsec verifies only with public keys from a key set. -
PRIVATE_KEY_MEMBERS
The key holds a private or symmetric member (d,p,q,dp,dq,qi,othork), so the set publishes key material it should not. Its public half is not used either. -
NOT_A_VERIFICATION_KEY
The key is not for verifying signatures: itsuseis notsig, itskey_opsis not an array of strings that containsverify, or the two members disagree (RFC 7517 sections 4.2 and 4.3). -
UNSUPPORTED_ALGORITHM
-
ALGORITHM_MISMATCH
The key'salgnames an algorithm for another key type or curve, such asES384on a P-256 key or any HMAC algorithm. -
UNSUPPORTED_CURVE
The key's curve (crv) is not P-256, P-384 or P-521 for anECkey, or not Ed25519 for anOKPkey. A key on secp256k1, Ed448, X25519 or X448 is skipped here unless an earlier check refuses it first:UNSUPPORTED_ALGORITHMforalgES256KorECDH-ES, orNOT_A_VERIFICATION_KEYforuseenc. -
RSA_KEY_SIZE
The RSA modulus is shorter than 2048 or longer than 16384 bits. -
RSA_EXPONENT
The RSA public exponent is even, below 65537 or at least 232. -
EC_POINT_NOT_ON_CURVE
An EC coordinate is not below the field prime, or the point is not on the curve. -
WEAK_KEY
The key is well formed but known to be weak: an RSA modulus with the ROCA fingerprint (CVE-2017-15361), or an Ed25519 point of small order. -
CERTIFICATE_MISMATCH
The key'sx5cis not an array whose first element is a certificate in standard base64 that parses strictly, or that certificate holds a different key.
-
-
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
-