- java.lang.Object
-
- org.cryptomator.cryptolib.common.CipherSupplier
-
public final class CipherSupplier extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static CipherSupplierAES_CTRstatic CipherSupplierAES_GCMstatic CipherSupplierRFC3394_KEYWRAP
-
Constructor Summary
Constructors Constructor Description CipherSupplier(String cipherAlgorithm)
-
Method Summary
-
-
-
Field Detail
-
AES_CTR
public static final CipherSupplier AES_CTR
-
AES_GCM
public static final CipherSupplier AES_GCM
-
RFC3394_KEYWRAP
public static final CipherSupplier RFC3394_KEYWRAP
-
-
Constructor Detail
-
CipherSupplier
public CipherSupplier(String cipherAlgorithm)
-
-
Method Detail
-
encryptionCipher
public ObjectPool.Lease<Cipher> encryptionCipher(SecretKey key, AlgorithmParameterSpec params)
Leases a reusable cipher object initialized for encryption.- Parameters:
key- Encryption keyparams- Params such as IV/Nonce- Returns:
- A lease supplying a refurbished Cipher
-
forEncryption
@Deprecated public Cipher forEncryption(SecretKey key, AlgorithmParameterSpec params)
Deprecated.UseencryptionCipher(SecretKey, AlgorithmParameterSpec)instead.Creates a new Cipher object initialized for encryption.- Parameters:
key- Encryption keyparams- Params such as IV/Nonce- Returns:
- New Cipher instance
-
decryptionCipher
public ObjectPool.Lease<Cipher> decryptionCipher(SecretKey key, AlgorithmParameterSpec params)
Leases a reusable cipher object initialized for decryption.- Parameters:
key- Decryption keyparams- Params such as IV/Nonce- Returns:
- A lease supplying a refurbished Cipher
-
forDecryption
@Deprecated public Cipher forDecryption(SecretKey key, AlgorithmParameterSpec params)
Deprecated.UsedecryptionCipher(SecretKey, AlgorithmParameterSpec)instead.Creates a new Cipher object initialized for decryption.- Parameters:
key- Encryption keyparams- Params such as IV/Nonce- Returns:
- New Cipher instance
-
keyWrapCipher
public ObjectPool.Lease<Cipher> keyWrapCipher(SecretKey kek)
Leases a reusable cipher object initialized for wrapping a key.- Parameters:
kek- Key encryption key- Returns:
- A lease supplying a refurbished Cipher
-
forWrapping
@Deprecated public Cipher forWrapping(SecretKey kek)
Deprecated.UsekeyWrapCipher(SecretKey)instead.Creates a new Cipher object initialized for wrapping a key.- Parameters:
kek- Key encryption key- Returns:
- New Cipher instance
-
keyUnwrapCipher
public ObjectPool.Lease<Cipher> keyUnwrapCipher(SecretKey kek)
Leases a reusable cipher object initialized for unwrapping a key.- Parameters:
kek- Key encryption key- Returns:
- A lease supplying a refurbished Cipher
-
forUnwrapping
@Deprecated public Cipher forUnwrapping(SecretKey kek)
Deprecated.UsekeyUnwrapCipher(SecretKey)instead.Creates a new Cipher object initialized for unwrapping a key.- Parameters:
kek- Key encryption key- Returns:
- New Cipher instance
-
-