Package com.couchbase.client.encryption
Class CryptoManager
- java.lang.Object
-
- com.couchbase.client.encryption.CryptoManager
-
public class CryptoManager extends Object
Encryption configuration manager set on the couchbase environment for encryption/decryption- Since:
- 1.0.0
- Author:
- Subhashni Balakrishnan
-
-
Constructor Summary
Constructors Constructor Description CryptoManager()
Creates an instance of Encryption configuration
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CryptoProvider
getProvider(String name)
Get an encryption algorithm providervoid
registerProvider(String name, CryptoProvider provider)
Add an encryption algorithm providervoid
throwMissingPublicKeyEx(String alias)
Private interface to workaround eager loading of exception classes in JVM throws the required public key missing exceptionvoid
throwSigningFailedEx(String alias)
Private interface to workaround eager loading of exception classes in JVM throws the required Signing failed exception
-
-
-
Method Detail
-
registerProvider
public void registerProvider(String name, CryptoProvider provider) throws Exception
Add an encryption algorithm provider- Parameters:
name
- an alias name for the encryption providerprovider
- Encryption provider implementation- Throws:
Exception
- if the alias name is null or empty
-
getProvider
public CryptoProvider getProvider(String name) throws Exception
Get an encryption algorithm provider- Parameters:
name
- an alias name for the encryption provider- Returns:
- encryption crypto provider instance
- Throws:
Exception
- if the alias is null or empty or not configured
-
throwMissingPublicKeyEx
public void throwMissingPublicKeyEx(String alias) throws Exception
Private interface to workaround eager loading of exception classes in JVM throws the required public key missing exception- Parameters:
alias
- the alias name for the provider- Throws:
Exception
- always
-
-