6
6
7
7
using System ;
8
8
9
+ #nullable enable
10
+
9
11
namespace Microsoft . Data . SqlClient
10
12
{
11
- /// <summary>
12
- /// Provides implementation similar to certificate store provider.
13
- /// A CEK encrypted with certificate store provider should be decryptable by this provider and vice versa.
14
- ///
15
- /// Envolope Format for the encrypted column encryption key
16
- /// version + keyPathLength + ciphertextLength + keyPath + ciphertext + signature
17
- /// version: A single byte indicating the format version.
18
- /// keyPathLength: Length of the keyPath.
19
- /// ciphertextLength: ciphertext length
20
- /// keyPath: keyPath used to encrypt the column encryption key. This is only used for troubleshooting purposes and is not verified during decryption.
21
- /// ciphertext: Encrypted column encryption key
22
- /// signature: Signature of the entire byte array. Signature is validated before decrypting the column encryption key.
23
- /// </summary>
13
+ /// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlColumnEncryptionCspProvider.xml' path='docs/members[@name="SqlColumnEncryptionCspProvider"]/SqlColumnEncryptionCspProvider/*' />
24
14
public class SqlColumnEncryptionCspProvider : SqlColumnEncryptionKeyStoreProvider
25
15
{
26
- /// <summary>
27
- /// Name for the CSP key store provider.
28
- /// </summary>
16
+ /// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlColumnEncryptionCspProvider.xml' path='docs/members[@name="SqlColumnEncryptionCspProvider"]/ProviderName/*' />
29
17
public const string ProviderName = @"MSSQL_CSP_PROVIDER" ;
30
18
31
19
/// <summary>
@@ -34,57 +22,30 @@ public class SqlColumnEncryptionCspProvider : SqlColumnEncryptionKeyStoreProvide
34
22
internal const string MasterKeyType = @"asymmetric key" ;
35
23
36
24
/// <summary>
37
- /// This encryption keystore uses the master key path to reference a CSP.
25
+ /// This encryption keystore uses the master key path to reference a CSP provider .
38
26
/// </summary>
39
27
internal const string KeyPathReference = @"Microsoft Cryptographic Service Provider (CSP)" ;
40
28
41
- /// <summary>
42
- /// This function uses the asymmetric key specified by the key path
43
- /// and decrypts an encrypted CEK with RSA encryption algorithm.
44
- /// </summary>
45
- /// <param name="masterKeyPath">Complete path of an asymmetric key in CSP</param>
46
- /// <param name="encryptionAlgorithm">Asymmetric Key Encryption Algorithm</param>
47
- /// <param name="encryptedColumnEncryptionKey">Encrypted Column Encryption Key</param>
48
- /// <returns>Plain text column encryption key</returns>
49
- public override byte [ ] DecryptColumnEncryptionKey ( string masterKeyPath , string encryptionAlgorithm ,
50
- byte [ ] encryptedColumnEncryptionKey )
29
+ /// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlColumnEncryptionCspProvider.xml' path='docs/members[@name="SqlColumnEncryptionCspProvider"]/DecryptColumnEncryptionKey/*' />
30
+ public override byte [ ] DecryptColumnEncryptionKey ( string ? masterKeyPath , string ? encryptionAlgorithm , byte [ ] ? encryptedColumnEncryptionKey )
51
31
{
52
32
throw new PlatformNotSupportedException ( ) ;
53
33
}
54
34
55
- /// <summary>
56
- /// This function uses the asymmetric key specified by the key path
57
- /// and encrypts CEK with RSA encryption algorithm.
58
- /// </summary>
59
- /// <param name="masterKeyPath">Complete path of an asymmetric key in AKV</param>
60
- /// <param name="encryptionAlgorithm">Asymmetric Key Encryption Algorithm</param>
61
- /// <param name="columnEncryptionKey">The plaintext column encryption key</param>
62
- /// <returns>Encrypted column encryption key</returns>
63
- public override byte [ ] EncryptColumnEncryptionKey ( string masterKeyPath , string encryptionAlgorithm ,
64
- byte [ ] columnEncryptionKey )
35
+ /// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlColumnEncryptionCspProvider.xml' path='docs/members[@name="SqlColumnEncryptionCspProvider"]/EncryptColumnEncryptionKey/*' />
36
+ public override byte [ ] EncryptColumnEncryptionKey ( string ? masterKeyPath , string ? encryptionAlgorithm , byte [ ] ? columnEncryptionKey )
65
37
{
66
38
throw new PlatformNotSupportedException ( ) ;
67
39
}
68
40
69
- /// <summary>
70
- /// Throws NotSupportedException. In this version of .NET Framework this provider does not support signing column master key metadata.
71
- /// </summary>
72
- /// <param name="masterKeyPath">Complete path of an asymmetric key. Path format is specific to a key store provider.</param>
73
- /// <param name="allowEnclaveComputations">Boolean indicating whether this key can be sent to trusted enclave</param>
74
- /// <returns>Encrypted column encryption key</returns>
75
- public override byte [ ] SignColumnMasterKeyMetadata ( string masterKeyPath , bool allowEnclaveComputations )
41
+ /// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlColumnEncryptionCspProvider.xml' path='docs/members[@name="SqlColumnEncryptionCspProvider"]/SignColumnMasterKeyMetadata/*' />
42
+ public override byte [ ] SignColumnMasterKeyMetadata ( string ? masterKeyPath , bool allowEnclaveComputations )
76
43
{
77
44
throw new PlatformNotSupportedException ( ) ;
78
45
}
79
46
80
- /// <summary>
81
- /// Throws NotSupportedException. In this version of .NET Framework this provider does not support verifying signatures of column master key metadata.
82
- /// </summary>
83
- /// <param name="masterKeyPath">Complete path of an asymmetric key. Path format is specific to a key store provider.</param>
84
- /// <param name="allowEnclaveComputations">Boolean indicating whether this key can be sent to trusted enclave</param>
85
- /// <param name="signature">Signature for the master key metadata</param>
86
- /// <returns>Boolean indicating whether the master key metadata can be verified based on the provided signature</returns>
87
- public override bool VerifyColumnMasterKeyMetadata ( string masterKeyPath , bool allowEnclaveComputations , byte [ ] signature )
47
+ /// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlColumnEncryptionCspProvider.xml' path='docs/members[@name="SqlColumnEncryptionCspProvider"]/VerifyColumnMasterKeyMetadata/*' />
48
+ public override bool VerifyColumnMasterKeyMetadata ( string ? masterKeyPath , bool allowEnclaveComputations , byte [ ] ? signature )
88
49
{
89
50
throw new PlatformNotSupportedException ( ) ;
90
51
}
0 commit comments