- java.lang.Object
-
- org.cryptomator.cryptolib.common.DestroyableSecretKey
-
- org.cryptomator.cryptolib.api.Masterkey
-
- All Implemented Interfaces:
Serializable,AutoCloseable,Key,SecretKey,Destroyable
public class Masterkey extends DestroyableSecretKey
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringENC_ALGstatic StringMAC_ALGstatic intSUBKEY_LEN_BYTES-
Fields inherited from interface javax.crypto.SecretKey
serialVersionUID
-
-
Constructor Summary
Constructors Constructor Description Masterkey(byte[] key)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Masterkeycopy()Returns an independent copy of this keystatic Masterkeyfrom(DestroyableSecretKey encKey, DestroyableSecretKey macKey)static Masterkeygenerate(SecureRandom csprng)DestroyableSecretKeygetEncKey()Get the encryption subkey.DestroyableSecretKeygetMacKey()Get the MAC subkey.-
Methods inherited from class org.cryptomator.cryptolib.common.DestroyableSecretKey
close, destroy, equals, from, generate, getAlgorithm, getEncoded, getFormat, hashCode, isDestroyed
-
-
-
-
Field Detail
-
ENC_ALG
public static final String ENC_ALG
- See Also:
- Constant Field Values
-
MAC_ALG
public static final String MAC_ALG
- See Also:
- Constant Field Values
-
SUBKEY_LEN_BYTES
public static final int SUBKEY_LEN_BYTES
- See Also:
- Constant Field Values
-
-
Method Detail
-
generate
public static Masterkey generate(SecureRandom csprng)
-
from
public static Masterkey from(DestroyableSecretKey encKey, DestroyableSecretKey macKey)
-
copy
public Masterkey copy()
Description copied from class:DestroyableSecretKeyReturns an independent copy of this key- Overrides:
copyin classDestroyableSecretKey- Returns:
- New copy of
this
-
getEncKey
public DestroyableSecretKey getEncKey()
Get the encryption subkey.- Returns:
- A new copy of the subkey used for encryption
-
getMacKey
public DestroyableSecretKey getMacKey()
Get the MAC subkey.- Returns:
- A new copy of the subkey used for message authentication
-
-