Class JsonWebPublicKey
java.lang.Object
de.christofreichardt.json.webkey.JsonWebKey
de.christofreichardt.json.webkey.JsonWebPublicKey
- All Implemented Interfaces:
de.christofreichardt.diagnosis.Traceable
Convenient for the handling of public keys in the spirit of RFC 7517 (JSON Web Key) and RFC 7518 (JSON Web Algorithms).
- Author:
- Christof Reichardt
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class -
Field Summary
Fields inherited from class JsonWebKey
EC_PARAMETER_SPEC_MAP, SECP256R1, SECP521R1 -
Method Summary
Modifier and TypeMethodDescriptionbooleanCompares thisJsonWebPublicKeywith anotherJsonWebPublicKey.static JsonWebPublicKeyfromJson(jakarta.json.JsonObject jwkView) Factory method to create aJsonWebPublicKeyinstance from a plainJsonObject.Returns the appliedAlgorithmParameterSpec, may be null.Returns the contained public key.inthashCode()A hash code for thisJsonWebPublicKey.static JsonWebPublicKey.BuilderCreates the builder for aJsonWebPublicKey.jakarta.json.JsonObjecttoJson()Converts thisJsonWebPublicKeyinto a plainJsonObject.toString()Returns a textual representation of thisJsonWebPublicKey.Methods inherited from class JsonWebKey
fromJson, getCurrentTracer, getKeyType, getKid
-
Method Details
-
of
Creates the builder for aJsonWebPublicKey.- Parameters:
publicKey- the given public key.- Returns:
- a
JsonWebPublicKey.Builder.
-
getPublicKey
-
getAlgorithmParameterSpec
Returns the appliedAlgorithmParameterSpec, may be null.- Returns:
- the applied
AlgorithmParameterSpec.
-
toString
Returns a textual representation of thisJsonWebPublicKey.- Overrides:
toStringin classJsonWebKey- Returns:
- a textual representation of this
JsonWebPublicKey.
-
equals
Compares thisJsonWebPublicKeywith anotherJsonWebPublicKey. Compares thisJsonWebPublicKeywith another ensuring that it contains the same configuration. Only objects of typeJsonWebPublicKeyare considered, other types return false. -
hashCode
-
toJson
public jakarta.json.JsonObject toJson()Converts thisJsonWebPublicKeyinto a plainJsonObject.- Overrides:
toJsonin classJsonWebKey- Returns:
- a
JsonObjectcorresponding to thisJsonWebPublicKey. - See Also:
-
fromJson
public static JsonWebPublicKey fromJson(jakarta.json.JsonObject jwkView) throws GeneralSecurityException Factory method to create aJsonWebPublicKeyinstance from a plainJsonObject.- Parameters:
jwkView- the givenJsonObject.- Returns:
- a
JsonWebPublicKey - Throws:
GeneralSecurityException- passed through from the underlying implementations of the algorithms by the JDK.
-