Class Jwks
java.lang.Object
com.revetsec.jose.Jwks
A JSON Web Key Set (RFC 7517 section 5): the usable public verification keys of a key set document, in document
order.
Keys that are not usable are skipped, never used in part, and never fail the set: a symmetric or
private key, a key for encryption, a curve or key type Revetsec does not support, a weak or malformed key, and the
rest of the cases JwkSkipReason lists. Only the document itself can fail: text that is not strict
JSON, not an object, without a keys array of objects, or over the size and key-count limits.
The fromJsonResult(String) operation applies the default limits of RemoteJwksSource: 256 KiB and 100 keys, every
element of keys counted. So at the default limits a document is accepted the same way from a string as from
the network.
Two key sets are equal when they hold equal keys in the same order.
- Since:
- 1.0.0
- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionbooleanCompares the keys, in order.static @NonNull JwksParseResultfromJsonResult(@NonNull String json) Parses a JSON Web Key Set document and returns the usable keys or a fixed structural rejection.getKeys()Returns the usable keys.inthashCode()Returns a hash of the keys, in order.toString()Describes the key set by its keys' public facts.
-
Method Details
-
fromJsonResult
Parses a JSON Web Key Set document and returns the usable keys or a fixed structural rejection. Malformed or unusable individual keys are skipped; only the document structure and limits reject the set. This static facade returns usable keys only: it exposes no skipped-key count, original indices or per-key skip reasons and emits no observer events. Remote fetches have separate JoseObserver skip callbacks.- Parameters:
json- untrusted document, at most 256 KiB as UTF-8 and 100 elements in its keys array- Returns:
- the parsing outcome; a successful key set may have no usable keys
- Throws:
NullPointerException- if the document is null- Since:
- 1.0.0
-
getKeys
-
equals
-
hashCode
-
toString
-