Package com.microsoft.sqlserver.jdbc

## Class SQLServerColumnEncryptionCertificateStoreProvider

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

    public final class SQLServerColumnEncryptionCertificateStoreProvider
    extends SQLServerColumnEncryptionKeyStoreProvider

The implementation of the key store provider for the Windows Certificate Store. This class enables using keys stored in the Windows Certificate Store as column master keys.

### Constructor Summary

Constructors
`SQLServerColumnEncryptionCertificateStoreProvider​()`

### Method Summary

All Methods Instance Methods Concrete Methods
`byte[]` `decryptColumnEncryptionKey​(String masterKeyPath, String encryptionAlgorithm, byte[] encryptedColumnEncryptionKey)` Base class method for decrypting the specified encrypted value of a column encryption key.
`byte[]` `encryptColumnEncryptionKey​(String masterKeyPath, String encryptionAlgorithm, byte[] plainTextColumnEncryptionKey)` Base class method for encrypting a column encryption key using the column master key with the specified key path and using the specified algorithm.
`String` `getName​()` Retrieves the name of this key store provider.
`void` `setName​(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

#### SQLServerColumnEncryptionCertificateStoreProvider

    public SQLServerColumnEncryptionCertificateStoreProvider​()

### Method Detail

#### setName

    public void setName​(String name)

Description copied from class: `SQLServerColumnEncryptionKeyStoreProvider`
Sets the name of this key store provider.

Specified by:
  `setName` in class `SQLServerColumnEncryptionKeyStoreProvider`
Parameters:
  `name` - value to be set for the key store provider.

#### getName

    public String getName​()

Description copied from class: `SQLServerColumnEncryptionKeyStoreProvider`
Retrieves the name of this key store provider.

Specified by:
  `getName` in class `SQLServerColumnEncryptionKeyStoreProvider`
Returns:
  the name of this key store provider.

#### encryptColumnEncryptionKey

    public byte[] encryptColumnEncryptionKey​(String masterKeyPath,
                                             String encryptionAlgorithm,
                                             byte[] plainTextColumnEncryptionKey)
                                      throws SQLServerException

Description copied from class: `SQLServerColumnEncryptionKeyStoreProvider`
Base class method for encrypting a column encryption key using the column master key with the specified key path and using the specified algorithm.

Specified by:
  `encryptColumnEncryptionKey` in class `SQLServerColumnEncryptionKeyStoreProvider`
Parameters:
  `masterKeyPath` - The column master key path.
  `encryptionAlgorithm` - the specific encryption algorithm.
  `plainTextColumnEncryptionKey` - column encryption key to be encrypted.
Returns:
  the encrypted column encryption key.
Throws:
  `SQLServerException` - when an error occurs while encrypting the CEK

#### decryptColumnEncryptionKey

    public byte[] decryptColumnEncryptionKey​(String masterKeyPath,
                                             String encryptionAlgorithm,
                                             byte[] encryptedColumnEncryptionKey)
                                      throws SQLServerException

Description copied from class: `SQLServerColumnEncryptionKeyStoreProvider`
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.

Specified by:
  `decryptColumnEncryptionKey` in class `SQLServerColumnEncryptionKeyStoreProvider`
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