Package web5.sdk.crypto.jwk
Class Jwk
-
- All Implemented Interfaces:
public final class JwkRepresents a JSON Web Key (Jwk ). A Jwk is a JSON object that represents a cryptographic key. This class provides functionalities to manage a Jwk including its creation, conversion to and from JSON, and computing a thumbprint.
Example:
var jwk = Jwk( kty: 'RSA', alg: 'RS256', use: 'sig', ... // other parameters );
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classJwk.BuilderBuilder for Jwk type.
-
Method Summary
Modifier and Type Method Description final StringgetKty()Represents the key type. final StringgetCrv()Elliptic curve name for EC keys. final StringgetUse()Represents the intended use of the public key. final StringgetAlg()Identifies the algorithm intended for use with the key. final StringgetKid()Key ID, unique identifier for the key. final UnitsetKid(String kid)Key ID, unique identifier for the key. final StringgetD()Private key component for EC or OKP keys. final StringgetX()X coordinate for EC keys, or the public key for OKP. final StringgetY()Y coordinate for EC keys. final StringcomputeThumbprint()Computes the thumbprint of the Jwk. StringtoString()-
-
Method Detail
-
computeThumbprint
final String computeThumbprint()
Computes the thumbprint of the Jwk. Specification.
Generates a thumbprint of the Jwk using SHA-256 hash function. The thumbprint is computed based on the key's kty, crv, x, and y values.
- Returns:
a Base64URL-encoded string representing the thumbprint.
-
-
-
-