| | | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | | 2 | | // Licensed under the MIT License. |
| | | 3 | | |
| | | 4 | | using System; |
| | | 5 | | using Azure.Core.Cryptography; |
| | | 6 | | |
| | | 7 | | namespace Azure.Storage |
| | | 8 | | { |
| | | 9 | | /// <summary> |
| | | 10 | | /// Provides the client configuration options for connecting to Azure Blob using clientside encryption. |
| | | 11 | | /// </summary> |
| | | 12 | | public class ClientSideEncryptionOptions |
| | | 13 | | { |
| | | 14 | | // NOTE there is a non-public Clone method for this class, compile-included into relevant packages from |
| | | 15 | | // Shared/ClientsideEncryption/ClientSideEncryptionOptionsExtensions.cs |
| | | 16 | | |
| | | 17 | | /// <summary> |
| | | 18 | | /// The version of clientside encryption to use. |
| | | 19 | | /// </summary> |
| | 0 | 20 | | public ClientSideEncryptionVersion EncryptionVersion { get; } |
| | | 21 | | |
| | | 22 | | /// <summary> |
| | | 23 | | /// Required for upload operations. |
| | | 24 | | /// The key used to wrap the generated content encryption key. |
| | | 25 | | /// For more information, see https://docs.microsoft.com/en-us/azure/storage/common/storage-client-side-encrypti |
| | | 26 | | /// </summary> |
| | 12 | 27 | | public IKeyEncryptionKey KeyEncryptionKey { get; set; } |
| | | 28 | | |
| | | 29 | | /// <summary> |
| | | 30 | | /// Required for download operations. |
| | | 31 | | /// Fetches the correct key encryption key to unwrap the downloaded content encryption key. |
| | | 32 | | /// For more information, see https://docs.microsoft.com/en-us/azure/storage/common/storage-client-side-encrypti |
| | | 33 | | /// </summary> |
| | 0 | 34 | | public IKeyEncryptionKeyResolver KeyResolver { get; set; } |
| | | 35 | | |
| | | 36 | | /// <summary> |
| | | 37 | | /// Required for upload operations. |
| | | 38 | | /// The algorithm identifier to use when wrapping the content encryption key. This is passed into |
| | | 39 | | /// <see cref="IKeyEncryptionKey.WrapKey(string, ReadOnlyMemory{byte}, System.Threading.CancellationToken)"/> |
| | | 40 | | /// and its async counterpart. |
| | | 41 | | /// </summary> |
| | 12 | 42 | | public string KeyWrapAlgorithm { get; set; } |
| | | 43 | | |
| | | 44 | | /// <summary> |
| | | 45 | | /// Initializes a new instance of the <see cref="ClientSideEncryptionOptions"/> class. |
| | | 46 | | /// </summary> |
| | | 47 | | /// <param name="version">The version of clientside encryption to use.</param> |
| | 6 | 48 | | public ClientSideEncryptionOptions(ClientSideEncryptionVersion version) |
| | | 49 | | { |
| | 6 | 50 | | EncryptionVersion = version; |
| | 6 | 51 | | } |
| | | 52 | | } |
| | | 53 | | } |