JsonWebKey

@Serializable
data class JsonWebKey(val algorithm: JsonWebAlgorithm? = null, val curve: ECCurve? = null, val e: ByteArray? = null, val k: ByteArray? = null, val keyOperations: Set<String>? = null, val keyId: String? = null, val type: JwkType? = null, val n: ByteArray? = null, val publicKeyUse: String? = null, val x: ByteArray? = null, val certificateChain: CertificateChain? = null, val certificateSha1Thumbprint: ByteArray? = null, val certificateUrl: String? = null, val certificateSha256Thumbprint: ByteArray? = null, val y: ByteArray? = null) : SpecializedCryptoPublicKey(source)

JSON Web Key as per RFC 7517.

Note that the members are ordered lexicographically, as required for JWK Thumbprint calculation, see RFC7638 s3

Constructors

Link copied to clipboard
constructor(algorithm: JsonWebAlgorithm? = null, curve: ECCurve? = null, e: ByteArray? = null, k: ByteArray? = null, keyOperations: Set<String>? = null, keyId: String? = null, type: JwkType? = null, n: ByteArray? = null, publicKeyUse: String? = null, x: ByteArray? = null, certificateChain: CertificateChain? = null, certificateSha1Thumbprint: ByteArray? = null, certificateUrl: String? = null, certificateSha256Thumbprint: ByteArray? = null, y: ByteArray? = null)

Types

Link copied to clipboard
object Companion

Contains convenience functions

Properties

Link copied to clipboard
@SerialName(value = "alg")
val algorithm: JsonWebAlgorithm? = null

The "alg" (algorithm) parameter identifies the algorithm intended for use with the key. The values used should either be registered in the IANA "JSON Web Signature and Encryption Algorithms" registry established by JWA or be a value that contains a Collision- Resistant Name. The "alg" value is a case-sensitive ASCII string. Use of this member is OPTIONAL.

Link copied to clipboard
@SerialName(value = "x5c")
val certificateChain: CertificateChain? = null

The "x5c" (X.509 certificate chain) parameter contains a chain of one or more PKIX certificates (RFC5280). The certificate chain is represented as a JSON array of certificate value strings. Each string in the array is a base64-encoded (Section 4 of (RFC4648) -- not base64url-encoded) DER (ITU.X690.1994) PKIX certificate value. The PKIX certificate containing the key value MUST be the first certificate. This MAY be followed by additional certificates, with each subsequent certificate being the one used to certify the previous one. The key in the first certificate MUST match the public key represented by other members of the JWK. Use of this member is OPTIONAL.

Link copied to clipboard
@SerialName(value = "x5t")
val certificateSha1Thumbprint: ByteArray? = null

The "x5t" (X.509 certificate SHA-1 thumbprint) parameter is a base64url-encoded SHA-1 thumbprint (a.k.a. digest) of the DER encoding of an X.509 certificate (RFC5280). Note that certificate thumbprints are also sometimes known as certificate fingerprints. The key in the certificate MUST match the public key represented by other members of the JWK. Use of this member is OPTIONAL.

Link copied to clipboard
@SerialName(value = "x5t#S256")
val certificateSha256Thumbprint: ByteArray? = null

The "x5t#S256" (X.509 certificate SHA-256 thumbprint) parameter is a base64url-encoded SHA-256 thumbprint (a.k.a. digest) of the DER encoding of an X.509 certificate (RFC5280). Note that certificate thumbprints are also sometimes known as certificate fingerprints. The key in the certificate MUST match the public key represented by other members of the JWK. Use of this member is OPTIONAL.

Link copied to clipboard
@SerialName(value = "x5u")
val certificateUrl: String? = null

The "x5u" (X.509 URL) parameter is a URI (RFC3986) that refers to a resource for an X.509 public key certificate or certificate chain (RFC5280). The identified resource MUST provide a representation of the certificate or certificate chain that conforms to RFC 5280 (RFC5280) in PEM-encoded form, with each certificate delimited as specified in Section 6.1 of RFC 4945 (RFC4945). The key in the first certificate MUST match the public key represented by other members of the JWK. The protocol used to acquire the resource MUST provide integrity protection; an HTTP GET request to retrieve the certificate MUST use TLS (RFC2818) (RFC5246); the identity of the server MUST be validated, as per Section 6 of RFC 6125 (RFC6125). Use of this member is OPTIONAL.

Link copied to clipboard
@SerialName(value = "crv")
val curve: ECCurve? = null

Set for EC keys only

Link copied to clipboard
Link copied to clipboard
@SerialName(value = "e")
val e: ByteArray? = null

Set for RSA keys only

Link copied to clipboard

Thumbprint in the form of urn:ietf:params:oauth:jwk-thumbprint:sha256:DEADBEEF

Link copied to clipboard
@SerialName(value = "k")
val k: ByteArray? = null

Set for symmetric keys only

Link copied to clipboard
@SerialName(value = "kid")
val keyId: String? = null

The "kid" (key ID) parameter is used to match a specific key. This is used, for instance, to choose among a set of keys within a JWK Set during key rollover. The structure of the "kid" value is unspecified. When "kid" values are used within a JWK Set, different keys within the JWK Set SHOULD use distinct "kid" values. (One example in which different keys might use the same "kid" value is if they have different "kty" (key type) values but are considered to be equivalent alternatives by the application using them.) The "kid" value is a case-sensitive string. Use of this member is OPTIONAL. When used with JWS or JWE, the "kid" value is used to match a JWS or JWE "kid" Header Parameter value.

Link copied to clipboard
@SerialName(value = "key_ops")
val keyOperations: Set<String>? = null

The "key_ops" (key operations) parameter identifies the operation(s) for which the key is intended to be used. The "key_ops" parameter is intended for use cases in which public, private, or symmetric keys may be present.

Link copied to clipboard
@SerialName(value = "n")
val n: ByteArray? = null

Set for RSA keys only

Link copied to clipboard
@SerialName(value = "use")
val publicKeyUse: String? = null

The "use" (public key use) parameter identifies the intended use of the public key. The "use" parameter is employed to indicate whether a public key is used for encrypting data or verifying the signature on data.

Link copied to clipboard
@SerialName(value = "kty")
val type: JwkType? = null

The "kty" (key type) parameter identifies the cryptographic algorithm family used with the key, such as "RSA" or "EC". "kty" values should either be registered in the IANA "JSON Web Key Types" registry established by (JWA) or be a value that contains a Collision-Resistant Name. The "kty" value is a case-sensitive string. This member MUST be present in a JWK.

Link copied to clipboard
@SerialName(value = "x")
val x: ByteArray? = null

Set for EC keys only

Link copied to clipboard
@SerialName(value = "y")
val y: ByteArray? = null

Set for EC keys only

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
Link copied to clipboard
open override fun toCryptoPublicKey(): KmmResult<CryptoPublicKey>
Link copied to clipboard
Link copied to clipboard
open override fun toString(): String