Class JwkSet
java.lang.Object
com.codename1.backend.security.crypto.JwkSet
- All Implemented Interfaces:
JwkSource
A set of keys, as a JSON Web Key Set publishes one (RFC 7517 5): what a
server that signs tokens serves at its jwks_uri, and what a server that
verifies them reads from there.
JwkSet keys = JwkSet.of(current, previous);
return HttpServer.Response.json(200, keys.toJson()); // public halves only
The set does not change. A server that rotates its key builds a new set and
answers with it from its JwkSource.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe key with this id, or null.getKeys()The keys, the one to sign with first.static JwkSetA set of these keys, the one to sign with first.static JwkSetThe public keys in a JSON Web Key Set document.toJson()toPublicJson()as text.The set as ajwks_uriserves it: the public half of every RSA and EC key.toString()Returns a string representation of the object.
-
Constructor Details
-
JwkSet
-
-
Method Details
-
of
-
parse
The public keys in a JSON Web Key Set document.
A key this runtime has no use for -- a type or a curve it does not verify with, an encryption key -- is left out rather than failing the set: a provider adding a key of a new kind must not stop the ones that were working.
- Throws:
IOException- when the text is not a key set at all
-
getKeys
-
get
-
toPublicJson
-
toJson
toPublicJson()as text. -
toString
Description copied from class:ObjectReturns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method. The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of: getClass().getName() + '@' + Integer.toHexString(hashCode())
-