Interface OKPJWK<A extends PublicKey,B extends PrivateKey>

Type Parameters:
A - the public key type
B - the private key type
All Superinterfaces:
AsymmetricJWK<A,B>, JWK, X509JWK<A,B>
All Known Subinterfaces:
EdECJWK, XECJWK

public interface OKPJWK<A extends PublicKey,B extends PrivateKey> extends X509JWK<A,B>

Octet Key Pair JSON Web Key.

An Octet Key Pair JWK is asymmetric.

Since:
1.5
Author:
Jeremy Kuhn
  • Field Details

  • Method Details

    • getCurve

      String getCurve()

      Returns the JWA Elliptic curve name.

      Returns:
      the Elliptic curve name
    • getPublicKey

      String getPublicKey()

      Returns the public key encoded as Base64URL.

      Returns:
      the Base64URL encoded public key with no padding.
    • getPrivateKey

      String getPrivateKey()

      Returns the private key encoded as Base64URL.

      Returns:
      the Base64URL encoded private key with no padding.
    • toPublicJWK

      OKPJWK<A,B> toPublicJWK()
      Description copied from interface: JWK

      Returns a public and safe to share representation of the key.

      Specified by:
      toPublicJWK in interface AsymmetricJWK<A extends PublicKey,B extends PrivateKey>
      Specified by:
      toPublicJWK in interface JWK
      Specified by:
      toPublicJWK in interface X509JWK<A extends PublicKey,B extends PrivateKey>
      Returns:
      a public representation of this JWK
    • minify

      OKPJWK<A,B> minify()
      Description copied from interface: JWK

      Returns a minified representation of the key only containing required data.

      Note that the returned JWK may contain private data.

      Specified by:
      minify in interface JWK
      Returns:
      a minified representation of this JWK
    • trust

      OKPJWK<A,B> trust()
      Description copied from interface: JWK

      Trusts the key explicitly.

      This should be used with care when the authenticity of an untrusted key has been established through external means.

      Specified by:
      trust in interface AsymmetricJWK<A extends PublicKey,B extends PrivateKey>
      Specified by:
      trust in interface JWK
      Specified by:
      trust in interface X509JWK<A extends PublicKey,B extends PrivateKey>
      Returns:
      this JWK