EncryptionAlgorithm

Sealed class representing the JWE key management algorithms defined in RFC 7518.

The key management algorithm determines how the Content Encryption Key (CEK) is protected in the JWE compact serialization. The supported algorithms are:

  • RsaOaep — RSA-OAEP with SHA-1 key wrapping.

  • RsaOaep256 — RSA-OAEP with SHA-256 key wrapping.

  • Dir — direct use of a shared symmetric key as the CEK; no key wrapping is performed.

Use fromId to look up an instance by its JWA identifier string.

See also

Inheritors

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data object Dir : EncryptionAlgorithm

Direct use of a shared symmetric CEK — no key wrapping.

Link copied to clipboard

Base class for RSA OAEP key encryption variants (RsaOaep and RsaOaep256).

Link copied to clipboard

RSA-OAEP with SHA-1. Key must be created with RSA.OAEP.keyPairGenerator(SHA1) or equivalent.

Link copied to clipboard

RSA-OAEP with SHA-256. Key must be created with RSA.OAEP.keyPairGenerator(SHA256) or equivalent.

Properties

Link copied to clipboard
open override val id: String

The JWA algorithm identifier string (e.g. "HS256", "RS256").

Functions

Link copied to clipboard
open override fun toString(): String