JwkKeys

object JwkKeys

Constants for JSON Web Key (JWK) field names.

These constants should be used instead of string literals when working with JWK objects to prevent typos and ensure consistency.

Example Usage:

val jwk = mapOf(
JwkKeys.KTY to "EC",
JwkKeys.CRV to "P-256",
JwkKeys.X to xCoordinate,
JwkKeys.Y to yCoordinate
)

val keyType = jwk[JwkKeys.KTY]

Properties

Link copied to clipboard
const val ALG: String

Algorithm (alg) - algorithm intended for use with the key.

Link copied to clipboard
const val CRV: String

Curve name (crv) - for elliptic curve keys. Common values: "P-256", "P-384", "P-521", "secp256k1", "Ed25519"

Link copied to clipboard
const val D: String

Private key (d) - for private keys (not typically in public JWKs).

Link copied to clipboard
const val E: String

Public exponent (e) - for RSA keys.

Link copied to clipboard
const val KEY_OPS: String

Key operations (key_ops) - array of operations the key is intended for.

Link copied to clipboard
const val KID: String

Key ID (kid) - optional key identifier.

Link copied to clipboard
const val KTY: String

Key type (kty) - identifies the cryptographic algorithm family. Common values: "EC", "RSA", "OKP", "oct"

Link copied to clipboard
const val N: String

Modulus (n) - for RSA keys.

Link copied to clipboard
const val USE: String

Key use (use) - intended use of the key. Common values: "sig", "enc"

Link copied to clipboard
const val X: String

X coordinate (x) - for EC and OKP keys.

Link copied to clipboard
const val Y: String

Y coordinate (y) - for EC keys.