EncryptionKeyPair

class EncryptionKeyPair(val identifier: EncryptionKey.Identifier, val publicKey: Key, val privateKey: Key) : EncryptionKey, JweProcessor(source)

A complete key pair that holds both public and private key material, implementing JweProcessor.

Produced automatically by mergeWith when an EncryptionOnlyKey and a DecryptionOnlyKey with the same Identifier are both registered in a co.touchlab.kjwt.model.registry.DefaultJwtProcessorRegistry. Supports both encryption and decryption.

Constructors

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

Properties

Link copied to clipboard
open override val algorithm: EncryptionAlgorithm
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 decryption; 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 encryption; throws on subtypes that do not hold a public key.

Functions

Link copied to clipboard
open suspend override fun decrypt(aad: ByteArray, encryptedKey: ByteArray, iv: ByteArray, data: ByteArray, tag: ByteArray, contentAlgorithm: EncryptionContentAlgorithm): ByteArray
Link copied to clipboard
open suspend override fun encrypt(data: ByteArray, aad: ByteArray, contentAlgorithm: EncryptionContentAlgorithm): JweEncryptResult
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 toString(): String