Package com.microsoft.sqlserver.jdbc

## Class SQLServerColumnEncryptionKeyStoreProvider

- java.lang.Object
- - com.microsoft.sqlserver.jdbc.SQLServerColumnEncryptionKeyStoreProvider

Direct Known Subclasses:
  `SQLServerColumnEncryptionAzureKeyVaultProvider`, `SQLServerColumnEncryptionCertificateStoreProvider`, `SQLServerColumnEncryptionJavaKeyStoreProvider`

    public abstract class SQLServerColumnEncryptionKeyStoreProvider
    extends java.lang.Object

Extend this class to implement a custom key store provider.

### Constructor Summary

Constructors
`SQLServerColumnEncryptionKeyStoreProvider​()`

### Method Summary

All Methods Instance Methods Abstract Methods
`abstract byte[]` `decryptColumnEncryptionKey​(java.lang.String masterKeyPath, java.lang.String encryptionAlgorithm, byte[] encryptedColumnEncryptionKey)` Base class method for decrypting the specified encrypted value of a column encryption key.
`abstract byte[]` `encryptColumnEncryptionKey​(java.lang.String masterKeyPath, java.lang.String encryptionAlgorithm, byte[] columnEncryptionKey)` Base class method for encrypting a column encryption key using the column master key with the specified key path and using the specified algorithm.
`abstract java.lang.String` `getName​()` Retrieves the name of this key store provider.
`abstract void` `setName​(java.lang.String name)` Sets the name of this key store provider.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### SQLServerColumnEncryptionKeyStoreProvider

    public SQLServerColumnEncryptionKeyStoreProvider​()

### Method Detail

#### setName

    public abstract void setName​(java.lang.String name)

Sets the name of this key store provider.

Parameters:
  `name` - value to be set for the key store provider.

#### getName

    public abstract java.lang.String getName​()

Retrieves the name of this key store provider.

Returns:
  the name of this key store provider.

#### decryptColumnEncryptionKey

    public abstract byte[] decryptColumnEncryptionKey​(java.lang.String masterKeyPath,
                                                      java.lang.String encryptionAlgorithm,
                                                      byte[] encryptedColumnEncryptionKey)
                                               throws SQLServerException

Base class method for decrypting the specified encrypted value of a column encryption key. The encrypted value is expected to be encrypted using the column master key with the specified key path and using the specified algorithm.

Parameters:
  `masterKeyPath` - The column master key path.
  `encryptionAlgorithm` - the specific encryption algorithm.
  `encryptedColumnEncryptionKey` - the encrypted column encryption key
Returns:
  the decrypted value of column encryption key.
Throws:
  `SQLServerException` - when an error occurs while decrypting the CEK

#### encryptColumnEncryptionKey

    public abstract byte[] encryptColumnEncryptionKey​(java.lang.String masterKeyPath,
                                                      java.lang.String encryptionAlgorithm,
                                                      byte[] columnEncryptionKey)
                                               throws SQLServerException

Base class method for encrypting a column encryption key using the column master key with the specified key path and using the specified algorithm.

Parameters:
  `masterKeyPath` - The column master key path.
  `encryptionAlgorithm` - the specific encryption algorithm.
  `columnEncryptionKey` - column encryption key to be encrypted.
Returns:
  the encrypted column encryption key.
Throws:
  `SQLServerException` - when an error occurs while encrypting the CEK