Class 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 Detail

      • CryptoManager

        public CryptoManager()
        Creates an instance of Encryption configuration
    • 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 provider
        provider - 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
      • throwSigningFailedEx

        public void throwSigningFailedEx​(String alias)
                                  throws Exception
        Private interface to workaround eager loading of exception classes in JVM throws the required Signing failed exception
        Parameters:
        alias - the alias name for the provider
        Throws:
        Exception - always