Share via


你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

BlobRequestOptions.RequireEncryption 属性

定义

获取或设置一个值,该值指示是否应加密客户端库写入和读取的数据。

public bool? RequireEncryption { get; set; }
member this.RequireEncryption : Nullable<bool> with get, set
Public Property RequireEncryption As Nullable(Of Boolean)

属性值

使用 true 指定应对所有事务加密/解密数据;否则 false为 。

实现

示例

// Instruct the client library to fail if data read from the service is not encrypted.
BlobRequestOptions requireEncryptionRequestOptions = new BlobRequestOptions() { RequireEncryption = true };

byteCount = blob.DownloadToByteArray(destinationArray, index: 0, accessCondition: null, options: requireEncryptionRequestOptions);

注解

此处的 RequireEncryption 是指Client-Side加密。 如果此值设置为 true,则如果未使用加密策略加密/解密数据,则所有调用都将失败。 如果此值 (默认) 为 false,则下载的任何未加密数据都将按原样返回。

适用于