| | | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | | 2 | | // Licensed under the MIT License. See License.txt in the project root for license information. |
| | | 3 | | |
| | | 4 | | namespace Microsoft.Azure.Batch |
| | | 5 | | { |
| | | 6 | | using System; |
| | | 7 | | |
| | | 8 | | public sealed class AzureStorageAuthenticationKey |
| | | 9 | | { |
| | | 10 | | /// <summary> |
| | | 11 | | /// Gets the Azure Storage Account key. |
| | | 12 | | /// </summary> |
| | 935 | 13 | | public string AccountKey { get; } |
| | | 14 | | |
| | | 15 | | /// <summary> |
| | | 16 | | /// Gets the Azure Storage SAS key. |
| | | 17 | | /// </summary> |
| | 935 | 18 | | public string SasKey { get; } |
| | | 19 | | |
| | 935 | 20 | | private AzureStorageAuthenticationKey(string accountKey = null, string sasKey = null) |
| | | 21 | | { |
| | 935 | 22 | | AccountKey = accountKey; |
| | 935 | 23 | | SasKey = sasKey; |
| | 935 | 24 | | } |
| | | 25 | | |
| | | 26 | | /// <summary> |
| | | 27 | | /// Creates a new <see cref="AzureStorageAuthenticationKey"/> referencing an Azure Storage Account key. |
| | | 28 | | /// </summary> |
| | | 29 | | /// <param name="key">The Storage Account key.</param> |
| | | 30 | | /// <returns>A new <see cref="AzureStorageAuthenticationKey"/> referencing the Azure Storage Account key.</retur |
| | 0 | 31 | | public static AzureStorageAuthenticationKey FromAccountKey(string key) => new AzureStorageAuthenticationKey(acco |
| | | 32 | | |
| | | 33 | | /// <summary> |
| | | 34 | | /// Creates a new <see cref="AzureStorageAuthenticationKey"/> referencing an Azure Storage SAS key. |
| | | 35 | | /// </summary> |
| | | 36 | | /// <param name="key">The Storage SAS key.</param> |
| | | 37 | | /// <returns>A new <see cref="AzureStorageAuthenticationKey"/> referencing the Azure Storage SAS key.</returns> |
| | 0 | 38 | | public static AzureStorageAuthenticationKey FromSasKey(string key) => new AzureStorageAuthenticationKey(sasKey: |
| | | 39 | | } |
| | | 40 | | } |