Skip to content

Commit a7be2f4

Browse files
Updates to async APIs - addressed feedback
1 parent 5af579f commit a7be2f4

5 files changed

Lines changed: 619 additions & 15 deletions

File tree

doc/snippets/Microsoft.Data.SqlClient/SqlColumnEncryptionKeyStoreProvider.xml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
<param name="encryptedColumnEncryptionKey">
3838
The encrypted column encryption key.
3939
</param>
40+
<param name="cancellationToken">
41+
A token to cancel the asynchronous operation.
42+
</param>
4043
<summary>
4144
Decrypts the specified encrypted value of a column encryption key asynchronously. The encrypted value is expected to be encrypted using the column master key with the specified key path and using the specified algorithm.
4245
</summary>
@@ -71,6 +74,9 @@
7174
<param name="columnEncryptionKey">
7275
The plaintext column encryption key.
7376
</param>
77+
<param name="cancellationToken">
78+
A token to cancel the asynchronous operation.
79+
</param>
7480
<summary>
7581
Encrypts a column encryption key asynchronously using the column master key with the specified key path and using the specified algorithm.
7682
</summary>
@@ -110,6 +116,9 @@
110116
<param name="allowEnclaveComputations">
111117
<see langword="true" /> to indicate that the column master key supports enclave computations; otherwise, <see langword="false" />.
112118
</param>
119+
<param name="cancellationToken">
120+
A token to cancel the asynchronous operation.
121+
</param>
113122
<summary>
114123
When implemented in a derived class, asynchronously digitally signs the column master key metadata with the column master key referenced by the <paramref name="masterKeyPath" /> parameter. The input values used to generate the signature should be the specified values of the <paramref name="masterKeyPath" /> and <paramref name="allowEnclaveComputations" /> parameters.
115124
</summary>
@@ -118,15 +127,12 @@
118127
</returns>
119128
<remarks>
120129
<para>
121-
To ensure that the <see cref="M:Microsoft.Data.SqlClient.SqlColumnEncryptionKeyStoreProvider.SignColumnMasterKeyMetadata(System.String,System.Boolean)" /> method doesn't break applications that rely on an old API, it throws a <see cref="T:System.NotImplementedException" /> exception by default.
130+
The default implementation calls the synchronous <see cref="M:Microsoft.Data.SqlClient.SqlColumnEncryptionKeyStoreProvider.SignColumnMasterKeyMetadata(System.String,System.Boolean)" /> method, which throws a <see cref="T:System.NotImplementedException" /> by default. In this case, the returned task will be faulted with <see cref="T:System.NotImplementedException" />.
122131
</para>
123132
<para>
124-
The <see cref="M:Microsoft.Data.SqlClient.SqlColumnEncryptionKeyStoreProvider.SignColumnMasterKeyMetadata(System.String,System.Boolean)" /> method will be used by client tools that generate Column Master Keys (CMK) for customers. <see cref="M:Microsoft.Data.SqlClient.SqlColumnEncryptionKeyStoreProvider.SignColumnMasterKeyMetadata(System.String,System.Boolean)" /> must be implemented by the corresponding key store providers that wish to use enclaves with <see href="https://learn.microsoft.com/sql/relational-databases/security/encryption/always-encrypted-database-engine">Always Encrypted</see>.
133+
Key store providers that wish to use enclaves with <see href="https://learn.microsoft.com/sql/relational-databases/security/encryption/always-encrypted-database-engine">Always Encrypted</see> should override this method with a truly asynchronous implementation when the signing operation involves I/O.
125134
</para>
126135
</remarks>
127-
<exception cref="T:System.NotImplementedException">
128-
In all cases.
129-
</exception>
130136
</SignColumnMasterKeyMetadataAsync>
131137
<VerifyColumnMasterKeyMetadata>
132138
<param name="masterKeyPath">
@@ -155,11 +161,14 @@
155161
<param name="signature">
156162
The signature of the column master key metadata.
157163
</param>
164+
<param name="cancellationToken">
165+
A token to cancel the asynchronous operation.
166+
</param>
158167
<summary>
159-
When implemented in a derived class, this method is expected to verify the specified signature is valid for the column master key with the specified key path and the specified enclave behavior asynchronously. The default implementation throws `NotImplementedException`.
168+
When implemented in a derived class, this method is expected to verify the specified signature is valid for the column master key with the specified key path and the specified enclave behavior asynchronously. The default implementation returns a faulted task with <see cref="T:System.NotImplementedException" />.
160169
</summary>
161170
<returns>
162-
When implemented in a derived class, the method is expected to return true if the specified signature is valid, or false if the specified signature is not valid. The default implementation throws `NotImplementedException`.
171+
A task that, when completed, returns <see langword="true" /> if the specified signature is valid, or <see langword="false" /> if it is not valid.
163172
</returns>
164173
</VerifyColumnMasterKeyMetadataAsync>
165174
<ColumnEncryptionKeyCacheTtl>

0 commit comments

Comments
 (0)