Table of Contents

Class AesKeyOptions

Namespace
Cuemon.Security.Cryptography
Assembly
Cuemon.Security.Cryptography.dll

Configuration options for GenerateKey(Action<AesKeyOptions>).

public class AesKeyOptions : IParameterObject
Inheritance
Object
AesKeyOptions
Implements

Constructors

AesKeyOptions()

Initializes a new instance of the AesKeyOptions class.

public AesKeyOptions()

Remarks

The following table shows the initial property values for an instance of AesKeyOptions.

PropertyInitial Value
RandomStringProvider
size =>
{
if (size > AesSize.Aes256 || size < AesSize.Aes128) { throw new InvalidEnumArgumentException(nameof(size), (int)size, typeof(AesSize)); }
var characters = Alphanumeric.Letters + Alphanumeric.PunctuationMarks;
switch (size)
{
case AesSize.Aes128:
   return Generate.RandomString(128 / ByteUnit.BitsPerByte, characters);
case AesSize.Aes192:
   return Generate.RandomString(192 / ByteUnit.BitsPerByte, characters);
default:
   return Generate.RandomString(256 / ByteUnit.BitsPerByte, characters);
}
};
SizeAes256

Properties

RandomStringProvider

Gets or sets the function delegate that provides a random generated string.

public Func<AesSize, string> RandomStringProvider { get; set; }

Property Value

Func<AesSize, String>

The function delegate that provides a random generated string.

Exceptions

System.ArgumentNullException

value cannot be null.

Size

Gets or sets the size of the Advanced Encryption Standard (AES) symmetric algorithm.

public AesSize Size { get; set; }

Property Value

AesSize

The size of the Advanced Encryption Standard (AES) symmetric algorithm.

Exceptions

System.ComponentModel.InvalidEnumArgumentException

value is not a valid value of AesSize.