Package com.nimbusds.jose.crypto.impl
Class AESKW
- java.lang.Object
-
- com.nimbusds.jose.crypto.impl.AESKW
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method 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).
-
-
-
Method Detail
-
wrapCEK
public static byte[] wrapCEK(SecretKey cek, SecretKey kek, Provider provider) throws JOSEException
Wraps the specified Content Encryption Key (CEK).- Parameters:
cek
- The Content Encryption Key (CEK) to wrap. Must not benull
.kek
- The AES Key Encryption Key (KEK) (wrapping key). Must not benull
.provider
- The specific JCA provider to use,null
implies the default system one.- Returns:
- The wrapped Content Encryption Key (CEK).
- Throws:
JOSEException
- If wrapping failed.
-
unwrapCEK
public static SecretKey unwrapCEK(SecretKey kek, byte[] encryptedCEK, Provider provider) throws JOSEException
Unwraps the specified encrypted Content Encryption Key (CEK).- Parameters:
kek
- The AES Key Encryption Key (KEK) (wrapping key). Must not benull
.encryptedCEK
- The wrapped Content Encryption Key (CEK) with authentication tag. Must not benull
.provider
- The specific JCA provider to use,null
implies the default system one.- Returns:
- The unwrapped Content Encryption Key (CEK).
- Throws:
JOSEException
- If unwrapping failed.
-
-