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
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
    <pre><code class="lang-csharp">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);
        }
    };</code></pre>
    </td></tr><tr><td class="term"><xref href="Cuemon.Security.Cryptography.AesKeyOptions.Size" data-throw-if-not-resolved="false"></xref></td><td class="description"><xref href="Cuemon.Security.Cryptography.AesSize.Aes256" data-throw-if-not-resolved="false"></xref></td></tr></tbody></table>

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

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

InvalidEnumArgumentException

value is not a valid value of AesSize.