Package org.cryptomator.cryptolib.api
Interface CryptorProvider
-
- All Known Implementing Classes:
CryptorProviderImpl
,CryptorProviderImpl
public interface CryptorProvider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Cryptor
createFromKeyFile(KeyFile keyFile, CharSequence passphrase, byte[] pepper, int expectedVaultVersion)
Cryptor
createFromKeyFile(KeyFile keyFile, CharSequence passphrase, int expectedVaultVersion)
Shortcut forcreateFromKeyFile(KeyFile, CharSequence, byte[], int)
with en empty pepper.Cryptor
createFromRawKey(byte[] rawKey)
Cryptor
createNew()
-
-
-
Method Detail
-
createNew
Cryptor createNew()
- Returns:
- A new Cryptor instance using randomized keys
-
createFromRawKey
Cryptor createFromRawKey(byte[] rawKey) throws IllegalArgumentException
- Parameters:
rawKey
- The key to use for the new cryptor- Returns:
- A new Cryptor instance using the given key
- Throws:
IllegalArgumentException
- if the key is of invalid length- Since:
- 1.3.0
-
createFromKeyFile
Cryptor createFromKeyFile(KeyFile keyFile, CharSequence passphrase, int expectedVaultVersion) throws UnsupportedVaultFormatException, InvalidPassphraseException
Shortcut forcreateFromKeyFile(KeyFile, CharSequence, byte[], int)
with en empty pepper.- Parameters:
keyFile
- The parsed key filepassphrase
- The passphrase to use for decrypting the keyfileexpectedVaultVersion
- The vault version expected in this file- Returns:
- A new Cryptor instance using the keys from the supplied keyfile
- Throws:
UnsupportedVaultFormatException
- If the vault has been created with a different version thanexpectedVaultVersion
InvalidPassphraseException
- If the key derived from the passphrase could not be used to decrypt the keyfile.- See Also:
createFromKeyFile(KeyFile, CharSequence, byte[], int)
-
createFromKeyFile
Cryptor createFromKeyFile(KeyFile keyFile, CharSequence passphrase, byte[] pepper, int expectedVaultVersion) throws UnsupportedVaultFormatException, InvalidPassphraseException
- Parameters:
keyFile
- The parsed key filepassphrase
- The passphrase to use for decrypting the keyfilepepper
- An application-specific pepper added to the salt during key-derivation (if applicable)expectedVaultVersion
- The vault version expected in this file- Returns:
- A new Cryptor instance using the keys from the supplied keyfile
- Throws:
UnsupportedVaultFormatException
- If the vault has been created with a different version thanexpectedVaultVersion
InvalidPassphraseException
- If the key derived from the passphrase and pepper could not be used to decrypt the keyfile.- Since:
- 1.1.0
-
-