encryptWithJweProcessor

suspend fun encryptWithJweProcessor(processor: JweEncryptor, contentAlgorithm: EncryptionContentAlgorithm, keyId: String? = processor.keyId): JwtInstance.Jwe(source)

Suspends, encrypts the token using the given JweEncryptor, and returns the JWE compact serialization.

The encryptor handles key wrapping for the given contentAlgorithm; no key registry look-up is performed. The kid header parameter is set to keyId when provided.

Return

the resulting JwtInstance.Jwe compact serialization

Parameters

processor

the JweEncryptor that performs the key wrapping and content encryption

contentAlgorithm

the content encryption algorithm used to encrypt the payload

keyId

optional key ID to embed in the JWE header's kid field. Defaults to JweEncryptor.keyId.

See also