EncryptionData
class EncryptionData
Represents the encryption data that is stored on the service.
using Azure.Core.Cryptography;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
namespace Azure.Storage.Cryptography.Models
{
internal class EncryptionData
{
public string EncryptionMode { get; set; }
public KeyEnvelope WrappedContentKey { get; set; }
public EncryptionAgent EncryptionAgent { get; set; }
public byte[] ContentEncryptionIV { get; set; }
public EncryptedRegionInfo EncryptedRegionInfo { get; set; }
public IDictionary<string, string> KeyWrappingMetadata { get; set; }
private static string AgentString { get; } = GenerateAgentString();
[AsyncStateMachine(typeof(<CreateInternalV1_0>d__24))]
internal static ValueTask<EncryptionData> CreateInternalV1_0(byte[] contentEncryptionIv, string keyWrapAlgorithm, byte[] contentEncryptionKey, IKeyEncryptionKey keyEncryptionKey, bool async, CancellationToken cancellationToken)
{
<CreateInternalV1_0>d__24 stateMachine = default(<CreateInternalV1_0>d__24);
stateMachine.<>t__builder = AsyncValueTaskMethodBuilder<EncryptionData>.Create();
stateMachine.contentEncryptionIv = contentEncryptionIv;
stateMachine.keyWrapAlgorithm = keyWrapAlgorithm;
stateMachine.contentEncryptionKey = contentEncryptionKey;
stateMachine.keyEncryptionKey = keyEncryptionKey;
stateMachine.async = async;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<CreateInternalV2_0>d__25))]
internal static Task<EncryptionData> CreateInternalV2_0(string keyWrapAlgorithm, byte[] contentEncryptionKey, IKeyEncryptionKey keyEncryptionKey, bool async, CancellationToken cancellationToken)
{
<CreateInternalV2_0>d__25 stateMachine = default(<CreateInternalV2_0>d__25);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<EncryptionData>.Create();
stateMachine.keyWrapAlgorithm = keyWrapAlgorithm;
stateMachine.contentEncryptionKey = contentEncryptionKey;
stateMachine.keyEncryptionKey = keyEncryptionKey;
stateMachine.async = async;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
private static string GenerateAgentString()
{
Assembly assembly = typeof(EncryptionData).Assembly;
string text = "(" + RuntimeInformation.FrameworkDescription + "; " + RuntimeInformation.OSDescription + ")";
return "azsdk-net-" + assembly.GetName().Name + "/" + assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion + " " + text;
}
}
}