java.lang.Object
org.cryptomator.cryptolib.common.AesKeyWrap
-
Method Summary
Modifier and TypeMethodDescriptionstatic DestroyableSecretKeyunwrap(DestroyableSecretKey kek, byte[] wrappedKey, String wrappedKeyAlgorithm) static byte[]wrap(DestroyableSecretKey kek, SecretKey key)
-
Method Details
-
wrap
- 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)
-