Skip to content

Commit f5de5c1

Browse files
committed
Sync XML comments from primary classes to Unix versions
1 parent faa828b commit f5de5c1

File tree

2 files changed

+25
-101
lines changed

2 files changed

+25
-101
lines changed

src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlColumnEncryptionCngProvider.netcore.Unix.cs

Lines changed: 12 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,14 @@
66

77
using System;
88

9+
#nullable enable
10+
911
namespace Microsoft.Data.SqlClient
1012
{
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/*' />
2414
public class SqlColumnEncryptionCngProvider : SqlColumnEncryptionKeyStoreProvider
2515
{
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/*' />
2917
public const string ProviderName = @"MSSQL_CNG_STORE";
3018

3119
/// <summary>
@@ -38,51 +26,26 @@ public class SqlColumnEncryptionCngProvider : SqlColumnEncryptionKeyStoreProvide
3826
/// </summary>
3927
internal const string KeyPathReference = @"Microsoft Cryptography API: Next Generation (CNG) provider";
4028

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)
5031
{
5132
throw new PlatformNotSupportedException();
5233
}
5334

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)
6337
{
6438
throw new PlatformNotSupportedException();
6539
}
6640

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)
7443
{
7544
throw new PlatformNotSupportedException();
7645
}
7746

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)
8649
{
8750
throw new PlatformNotSupportedException();
8851
}

src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlColumnEncryptionCspProvider.netcore.Unix.cs

Lines changed: 13 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,14 @@
66

77
using System;
88

9+
#nullable enable
10+
911
namespace Microsoft.Data.SqlClient
1012
{
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/*' />
2414
public class SqlColumnEncryptionCspProvider : SqlColumnEncryptionKeyStoreProvider
2515
{
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/*' />
2917
public const string ProviderName = @"MSSQL_CSP_PROVIDER";
3018

3119
/// <summary>
@@ -34,57 +22,30 @@ public class SqlColumnEncryptionCspProvider : SqlColumnEncryptionKeyStoreProvide
3422
internal const string MasterKeyType = @"asymmetric key";
3523

3624
/// <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.
3826
/// </summary>
3927
internal const string KeyPathReference = @"Microsoft Cryptographic Service Provider (CSP)";
4028

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)
5131
{
5232
throw new PlatformNotSupportedException();
5333
}
5434

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)
6537
{
6638
throw new PlatformNotSupportedException();
6739
}
6840

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)
7643
{
7744
throw new PlatformNotSupportedException();
7845
}
7946

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)
8849
{
8950
throw new PlatformNotSupportedException();
9051
}

0 commit comments

Comments
 (0)