Class Jwk

  • All Implemented Interfaces:

    
    public final class Jwk
    
                        

    Represents a JSON Web Key (JWK) as per RFC7517. This is a partial representation, containing key parameters such as alg, kty, crv, and key material like x, y, and d.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final String getAlg() The algorithm intended for use with the key (optional).
      final String getKty() The key type (e.g.
      final String getCrv() The curve used with the key (e.g.
      final String getX() The x coordinate for elliptic curve keys, or the public key for OKP keys.
      final String getY() The y coordinate for elliptic curve keys (optional).
      final String getD() The private key material, if present (optional).
      final String computeThumbprint() Computes the thumbprint of the JWK.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getAlg

         final String getAlg()

        The algorithm intended for use with the key (optional).

      • getKty

         final String getKty()

        The key type (e.g., EC, OKP).

      • getCrv

         final String getCrv()

        The curve used with the key (e.g., Ed25519, X25519).

      • getX

         final String getX()

        The x coordinate for elliptic curve keys, or the public key for OKP keys.

      • getY

         final String getY()

        The y coordinate for elliptic curve keys (optional).

      • getD

         final String getD()

        The private key material, if present (optional).

      • computeThumbprint

         final String computeThumbprint()

        Computes the thumbprint of the JWK.

        A thumbprint is a cryptographic hash that uniquely identifies the JWK based on its key type and key material. This method utilizes Rust core logic to compute the thumbprint.

        Returns:

        A base64url-encoded thumbprint string.