Package com.microsoft.sqlserver.jdbc
Class SQLServerColumnEncryptionJavaKeyStoreProvider
- java.lang.Object
-
- com.microsoft.sqlserver.jdbc.SQLServerColumnEncryptionKeyStoreProvider
-
- com.microsoft.sqlserver.jdbc.SQLServerColumnEncryptionJavaKeyStoreProvider
-
public class SQLServerColumnEncryptionJavaKeyStoreProvider extends SQLServerColumnEncryptionKeyStoreProvider
Provides the implementation of the key store provider for Java Key Store. This class enables using certificates stored in the Java keystore as column master keys.
-
-
Constructor Summary
Constructors Constructor Description SQLServerColumnEncryptionJavaKeyStoreProvider(java.lang.String keyStoreLocation, char[] keyStoreSecret)Constructs a SQLServerColumnEncryptionJavaKeyStoreProvider for the Java Key Store.
-
Method Summary
Modifier and Type Method Description byte[]decryptColumnEncryptionKey(java.lang.String masterKeyPath, java.lang.String encryptionAlgorithm, byte[] encryptedColumnEncryptionKey)Decrypts the specified encrypted value of a column encryption key.byte[]encryptColumnEncryptionKey(java.lang.String masterKeyPath, java.lang.String encryptionAlgorithm, byte[] plainTextColumnEncryptionKey)Encrypts a column encryption key using the column master key with the specified key path and using the specified algorithm.java.lang.StringgetName()Returns the name of this key store provider.voidsetName(java.lang.String name)Sets the name of this key store provider.
-
-
-
Constructor Detail
-
SQLServerColumnEncryptionJavaKeyStoreProvider
public SQLServerColumnEncryptionJavaKeyStoreProvider(java.lang.String keyStoreLocation, char[] keyStoreSecret) throws SQLServerExceptionConstructs a SQLServerColumnEncryptionJavaKeyStoreProvider for the Java Key Store.- Parameters:
keyStoreLocation- specifies the location of the keystorekeyStoreSecret- specifies the secret used for keystore- Throws:
SQLServerException- when an error occurs
-
-
Method Detail
-
setName
public void setName(java.lang.String name)
Description copied from class:SQLServerColumnEncryptionKeyStoreProviderSets the name of this key store provider.- Specified by:
setNamein classSQLServerColumnEncryptionKeyStoreProvider- Parameters:
name- value to be set for the key store provider.
-
getName
public java.lang.String getName()
Description copied from class:SQLServerColumnEncryptionKeyStoreProviderReturns the name of this key store provider.- Specified by:
getNamein classSQLServerColumnEncryptionKeyStoreProvider- Returns:
- the name of this key store provider.
-
decryptColumnEncryptionKey
public byte[] decryptColumnEncryptionKey(java.lang.String masterKeyPath, java.lang.String encryptionAlgorithm, byte[] encryptedColumnEncryptionKey) throws SQLServerExceptionDescription copied from class:SQLServerColumnEncryptionKeyStoreProviderDecrypts 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:
decryptColumnEncryptionKeyin classSQLServerColumnEncryptionKeyStoreProvider- 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 byte[] encryptColumnEncryptionKey(java.lang.String masterKeyPath, java.lang.String encryptionAlgorithm, byte[] plainTextColumnEncryptionKey) throws SQLServerExceptionDescription copied from class:SQLServerColumnEncryptionKeyStoreProviderEncrypts a column encryption key using the column master key with the specified key path and using the specified algorithm.- Specified by:
encryptColumnEncryptionKeyin classSQLServerColumnEncryptionKeyStoreProvider- 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
-
-