Modifier and Type | Method and Description |
---|---|
static SecretKey |
unwrapCEK(SecretKey kek,
byte[] encryptedCEK,
Provider provider)
Unwraps the specified encrypted Content Encryption Key (CEK).
|
static byte[] |
wrapCEK(SecretKey cek,
SecretKey kek,
Provider provider)
Wraps the specified Content Encryption Key (CEK).
|
public static byte[] wrapCEK(SecretKey cek, SecretKey kek, Provider provider) throws JOSEException
cek
- The Content Encryption Key (CEK) to wrap. Must not
be null
.kek
- The AES Key Encryption Key (KEK) (wrapping key).
Must not be null
.provider
- The specific JCA provider to use, null
implies the default system one.JOSEException
- If wrapping failed.public static SecretKey unwrapCEK(SecretKey kek, byte[] encryptedCEK, Provider provider) throws JOSEException
kek
- The AES Key Encryption Key (KEK) (wrapping key).
Must not be null
.encryptedCEK
- The wrapped Content Encryption Key (CEK) with
authentication tag. Must not be null
.provider
- The specific JCA provider to use, null
implies the default system one.JOSEException
- If unwrapping failed.Copyright © 2019 Connect2id Ltd.. All rights reserved.