public static interface KeyDerivation.Lazy
| Modifier and Type | Method and Description |
|---|---|
Key |
cryptoKdfDeriveFromKey(int lengthOfSubKey,
long subKeyId,
java.lang.String context,
Key masterKey)
Derive a subkey from a master key.
|
Key |
cryptoKdfKeygen()
Auto generates a master key and returns
it in string format.
|
Key cryptoKdfKeygen()
Key cryptoKdfDeriveFromKey(int lengthOfSubKey, long subKeyId, java.lang.String context, Key masterKey) throws SodiumException
lengthOfSubKey - The length of the subkey. Should be
from KeyDerivation.BYTES_MIN to KeyDerivation.BYTES_MAX.subKeyId - The ID of the subkey.context - The context of the subkey. Must be KeyDerivation.CONTEXT_BYTES.masterKey - The generated master key from cryptoKdfKeygen().Helpers.Lazy.sodiumBin2Hex(byte[]).SodiumException - If any of the lengths were not correct.