EncryptionKey
Represents a cryptographic key (or key pair) used for JWE encryption and/or decryption.
Instances are identified by a (EncryptionAlgorithm, optional key ID) pair captured in identifier. Depending on which key material is available, an EncryptionKey may be:
EncryptionOnlyKey — holds only the public key; used by co.touchlab.kjwt.builder.JwtBuilder to encrypt tokens.
DecryptionOnlyKey — holds only the private key; used by co.touchlab.kjwt.parser.JwtParser to decrypt tokens.
EncryptionKeyPair — holds both keys; supports both encryption and decryption.
Complementary keys that share the same Identifier can be merged into an EncryptionKeyPair via mergeWith. This happens automatically when both are registered with the same co.touchlab.kjwt.model.registry.DefaultJwtProcessorRegistry.
Each subtype directly implements the appropriate processor interface (JweEncryptor, JweDecryptor, or JweProcessor) and carries the cryptographic logic for its role.
See also
Inheritors
Types
A decryption-only key that holds only the private key material, implementing JweDecryptor.
A complete key pair that holds both public and private key material, implementing JweProcessor.
An encryption-only key that holds only the public key material, implementing JweEncryptor.
Identifies an EncryptionKey within a co.touchlab.kjwt.model.registry.DefaultJwtProcessorRegistry by algorithm and optional key ID.