SqlColumnEncryptionKeyStoreProvider.EncryptColumnEncryptionKeyAsync 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
使用具有指定密钥路径的列主密钥并使用指定的算法异步加密列加密密钥。
public virtual System.Threading.Tasks.Task<byte[]> EncryptColumnEncryptionKeyAsync(string masterKeyPath, string encryptionAlgorithm, byte[] columnEncryptionKey, System.Threading.CancellationToken cancellationToken = default);
abstract member EncryptColumnEncryptionKeyAsync : string * string * byte[] * System.Threading.CancellationToken -> System.Threading.Tasks.Task<byte[]>
override this.EncryptColumnEncryptionKeyAsync : string * string * byte[] * System.Threading.CancellationToken -> System.Threading.Tasks.Task<byte[]>
Public Overridable Function EncryptColumnEncryptionKeyAsync (masterKeyPath As String, encryptionAlgorithm As String, columnEncryptionKey As Byte(), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Byte())
参数
- masterKeyPath
- String
列主密钥路径。 路径格式特定于密钥存储提供程序实现(例如证书存储的指纹,或Azure 密钥保管库的密钥标识符 URL)。
- encryptionAlgorithm
- String
加密算法名称。 例如,RSA_OAEP。
- columnEncryptionKey
- Byte[]
要加密的列加密密钥。
- cancellationToken
- CancellationToken
用于取消异步操作的令牌。
返回
一个 Byte 任务,该任务在完成时返回表示加密列加密密钥的数组。
注解
默认实现首先检查 cancellationToken 并返回已取消的任务(如果已请求取消)。 否则,它会调用同步 EncryptColumnEncryptionKey(String, String, Byte[]) 方法,并将结果包装在已完成的任务中。 如果同步方法引发,则会捕获异常,并返回出错的任务,而不是同步引发。
执行 I/O 的派生类(如对Azure 密钥保管库的调用)应使用遵循取消令牌的真正异步实现重写此方法。