Class EdECJwkBuilder

java.lang.Object
uk.co.spudsoft.jwtvalidatorvertx.JwkBuilder
uk.co.spudsoft.jwtvalidatorvertx.impl.EdECJwkBuilder

public class EdECJwkBuilder extends JwkBuilder
JWKBuilder that parses and serializes Edwards-Curve elliptic curve (EC) public keys.
Author:
jtalbut
  • Constructor Details

    • EdECJwkBuilder

      public EdECJwkBuilder()
      Constructor. Typically it is not necessary to construct an explicit instance of this class, the methods in the JwkBuilder class should suffice.
  • Method Details

    • canHandleKey

      public boolean canHandleKey(PublicKey key)
      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 class JwkBuilder
      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 NoSuchAlgorithmException
      Description copied from class: JwkBuilder
      Convert the given public key into a valid JWK JSON representation.
      Specified by:
      toJson in class JwkBuilder
      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:
      NoSuchAlgorithmException - if the security subsystem does so.