Class ECJwkBuilder
java.lang.Object
uk.co.spudsoft.jwtvalidatorvertx.JwkBuilder
uk.co.spudsoft.jwtvalidatorvertx.impl.ECJwkBuilder
JWKBuilder that parses and serializes elliptic curve (EC) public keys.
- Author:
- jtalbut
-
Field Summary
Fields inherited from class uk.co.spudsoft.jwtvalidatorvertx.JwkBuilder
B64ENCODER
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
canHandleKey
(PublicKey key) Return true if the builder can create a JWK by generating JSON for the given PublicKey.io.vertx.core.json.JsonObject
Convert the given public key into a valid JWK JSON representation.Methods inherited from class uk.co.spudsoft.jwtvalidatorvertx.JwkBuilder
get
-
Constructor Details
-
ECJwkBuilder
public ECJwkBuilder()Constructor. Typically it is not necessary to construct an explicit instance of this class, the methods in theJwkBuilder
class should suffice.
-
-
Method Details
-
canHandleKey
Description copied from class:JwkBuilder
Return true if the builder can create a JWK by generating JSON for the given PublicKey.- Specified by:
canHandleKey
in classJwkBuilder
- Parameters:
key
- The key that that this builder is being asked about.- Returns:
- true if the builder can create a JWK by generating JSON for the given PublicKey.
-
toJson
public io.vertx.core.json.JsonObject toJson(String kid, String algorithm, PublicKey publicKey) throws InvalidParameterSpecException, NoSuchAlgorithmException Description copied from class:JwkBuilder
Convert the given public key into a valid JWK JSON representation.- Specified by:
toJson
in classJwkBuilder
- Parameters:
kid
- The ID for the key.algorithm
- The algorithm to be used with the key.publicKey
- The public key.- Returns:
- The JWK representation of the key,
- Throws:
InvalidParameterSpecException
- if the security subsystem does so.NoSuchAlgorithmException
- if the security subsystem does so.
-