VerifyOnlyKey

class VerifyOnlyKey(val identifier: SigningKey.Identifier, val publicKey: Key) : SigningKey, JwsVerifier(source)

A verify-only key that holds only the public key material, implementing JwsVerifier.

Used when tokens must be verified but signing is not required (e.g. a service that only consumes tokens). Accessing privateKey on this type throws.

Constructors

Link copied to clipboard
constructor(identifier: SigningKey.Identifier, publicKey: Key)

Properties

Link copied to clipboard
open override val algorithm: SigningAlgorithm
Link copied to clipboard

The algorithm and key ID that identify this key within a registry.

Link copied to clipboard
open override val keyId: String?
Link copied to clipboard
open override val privateKey: Key

The private key material used for signing; throws on subtypes that do not hold a private key.

Link copied to clipboard
open override val publicKey: Key

The public key material used for signature verification; throws on subtypes that do not hold a public key.

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
open override fun toString(): String
Link copied to clipboard
open suspend override fun verify(data: ByteArray, signature: ByteArray): Boolean