Package org.cryptomator.cryptolib.common
Class AesKeyWrap
- java.lang.Object
-
- org.cryptomator.cryptolib.common.AesKeyWrap
-
public class AesKeyWrap extends Object
-
-
Constructor Summary
Constructors Constructor Description AesKeyWrap()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DestroyableSecretKey
unwrap(DestroyableSecretKey kek, byte[] wrappedKey, String wrappedKeyAlgorithm)
static byte[]
wrap(DestroyableSecretKey kek, SecretKey key)
-
-
-
Method Detail
-
wrap
public static byte[] wrap(DestroyableSecretKey kek, SecretKey key)
- Parameters:
kek
- Key encrypting keykey
- Key to be wrapped- Returns:
- Wrapped key
-
unwrap
public static DestroyableSecretKey unwrap(DestroyableSecretKey kek, byte[] wrappedKey, String wrappedKeyAlgorithm) throws InvalidKeyException
- Parameters:
kek
- Key encrypting keywrappedKey
- Key to be unwrappedwrappedKeyAlgorithm
- Key designation, i.e. algorithm to be associated with the unwrapped key.- Returns:
- Unwrapped key
- Throws:
InvalidKeyException
- If unwrapping failed (i.e. wrong kek)
-
-