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 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/SqlColumnEncryptionCngProvider.xml' path='docs/members[@name="SqlColumnEncryptionCngProvider"]/SqlColumnEncryptionCngProvider/*' />
24
14
public class SqlColumnEncryptionCngProvider : SqlColumnEncryptionKeyStoreProvider
25
15
{
26
- /// <summary>
27
- /// Name for the CNG key store provider.
28
- /// </summary>
16
+ /// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlColumnEncryptionCngProvider.xml' path='docs/members[@name="SqlColumnEncryptionCngProvider"]/ProviderName/*' />
29
17
public const string ProviderName = @"MSSQL_CNG_STORE" ;
30
18
31
19
/// <summary>
@@ -38,51 +26,26 @@ public class SqlColumnEncryptionCngProvider : SqlColumnEncryptionKeyStoreProvide
38
26
/// </summary>
39
27
internal const string KeyPathReference = @"Microsoft Cryptography API: Next Generation (CNG) provider" ;
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 CNG</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 , byte [ ] encryptedColumnEncryptionKey )
29
+ /// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlColumnEncryptionCngProvider.xml' path='docs/members[@name="SqlColumnEncryptionCngProvider"]/DecryptColumnEncryptionKey/*' />
30
+ public override byte [ ] DecryptColumnEncryptionKey ( string ? masterKeyPath , string ? encryptionAlgorithm , byte [ ] ? encryptedColumnEncryptionKey )
50
31
{
51
32
throw new PlatformNotSupportedException ( ) ;
52
33
}
53
34
54
- /// <summary>
55
- /// This function uses the asymmetric key specified by the key path
56
- /// and encrypts CEK with RSA encryption algorithm.
57
- /// </summary>
58
- /// <param name="masterKeyPath">Complete path of an asymmetric key in AKV</param>
59
- /// <param name="encryptionAlgorithm">Asymmetric Key Encryption Algorithm</param>
60
- /// <param name="columnEncryptionKey">The plaintext column encryption key</param>
61
- /// <returns>Encrypted column encryption key</returns>
62
- public override byte [ ] EncryptColumnEncryptionKey ( string masterKeyPath , string encryptionAlgorithm , byte [ ] columnEncryptionKey )
35
+ /// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlColumnEncryptionCngProvider.xml' path='docs/members[@name="SqlColumnEncryptionCngProvider"]/EncryptColumnEncryptionKey/*' />
36
+ public override byte [ ] EncryptColumnEncryptionKey ( string ? masterKeyPath , string ? encryptionAlgorithm , byte [ ] ? columnEncryptionKey )
63
37
{
64
38
throw new PlatformNotSupportedException ( ) ;
65
39
}
66
40
67
- /// <summary>
68
- /// Throws NotSupportedException. In this version of .NET Framework this provider does not support signing column master key metadata.
69
- /// </summary>
70
- /// <param name="masterKeyPath">Complete path of an asymmetric key. Path format is specific to a key store provider.</param>
71
- /// <param name="allowEnclaveComputations">Boolean indicating whether this key can be sent to trusted enclave</param>
72
- /// <returns>Encrypted column encryption key</returns>
73
- public override byte [ ] SignColumnMasterKeyMetadata ( string masterKeyPath , bool allowEnclaveComputations )
41
+ /// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlColumnEncryptionCngProvider.xml' path='docs/members[@name="SqlColumnEncryptionCngProvider"]/SignColumnMasterKeyMetadata/*' />
42
+ public override byte [ ] SignColumnMasterKeyMetadata ( string ? masterKeyPath , bool allowEnclaveComputations )
74
43
{
75
44
throw new PlatformNotSupportedException ( ) ;
76
45
}
77
46
78
- /// <summary>
79
- /// Throws NotSupportedException. In this version of .NET Framework this provider does not support verifying signatures of column master key metadata.
80
- /// </summary>
81
- /// <param name="masterKeyPath">Complete path of an asymmetric key. Path format is specific to a key store provider.</param>
82
- /// <param name="allowEnclaveComputations">Boolean indicating whether this key can be sent to trusted enclave</param>
83
- /// <param name="signature">Signature for the master key metadata</param>
84
- /// <returns>Boolean indicating whether the master key metadata can be verified based on the provided signature</returns>
85
- public override bool VerifyColumnMasterKeyMetadata ( string masterKeyPath , bool allowEnclaveComputations , byte [ ] signature )
47
+ /// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlColumnEncryptionCngProvider.xml' path='docs/members[@name="SqlColumnEncryptionCngProvider"]/VerifyColumnMasterKeyMetadata/*' />
48
+ public override bool VerifyColumnMasterKeyMetadata ( string ? masterKeyPath , bool allowEnclaveComputations , byte [ ] ? signature )
86
49
{
87
50
throw new PlatformNotSupportedException ( ) ;
88
51
}
0 commit comments