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

BlobRequestOptions.EncryptionPolicy 属性

定义

获取或设置请求的加密策略。

public Microsoft.Azure.Storage.Blob.BlobEncryptionPolicy EncryptionPolicy { get; set; }
member this.EncryptionPolicy : Microsoft.Azure.Storage.Blob.BlobEncryptionPolicy with get, set
Public Property EncryptionPolicy As BlobEncryptionPolicy

属性值

一个 EncryptionPolicy 类型的对象。

示例


// Create the Key to be used for wrapping.
// This code creates a random encryption key.
SymmetricKey aesKey = new SymmetricKey(kid: "symencryptionkey");

// Create the encryption policy to be used for upload.
BlobEncryptionPolicy uploadPolicy = new BlobEncryptionPolicy(key: aesKey, keyResolver: null);

// Set the encryption policy on the request options.
BlobRequestOptions uploadOptions = new BlobRequestOptions() { EncryptionPolicy = uploadPolicy };

// Encrypt and upload the data to the blob.
MemoryStream stream = new MemoryStream(buffer);
blob.UploadFromStream(stream, length: size, accessCondition: null, options: uploadOptions);

适用于