StorageSharedKeyCredential
A StorageSharedKeyCredential is a credential backed by
a Storage Account's name and one of its access keys.
using System;
using System.Security.Cryptography;
using System.Text;
using System.Threading;
namespace Azure.Storage
{
public class StorageSharedKeyCredential
{
private byte[] ;
public string { get; }
private byte[] {
get {
return Volatile.Read(ref _accountKeyValue);
}
set {
Volatile.Write(ref _accountKeyValue, value);
}
}
public StorageSharedKeyCredential(string accountName, string accountKey)
{
AccountName = accountName;
SetAccountKey(accountKey);
}
public void (string accountKey)
{
AccountKeyValue = Convert.FromBase64String(accountKey);
}
internal string (string message)
{
return Convert.ToBase64String(HMACSHA256.HashData(AccountKeyValue, Encoding.UTF8.GetBytes(message)));
}
protected static string (StorageSharedKeyCredential credential, string message)
{
return credential.ComputeHMACSHA256(message);
}
}
}