Secret Class

Definition

Represents a secret value stored in memory.

public ref class Secret sealed : IDisposable, Microsoft::AspNetCore::DataProtection::ISecret
public sealed class Secret : IDisposable, Microsoft.AspNetCore.DataProtection.ISecret
type Secret = class
    interface IDisposable
    interface ISecret
Public NotInheritable Class Secret
Implements IDisposable, ISecret
Inheritance
Secret
Implements

Constructors

Secret(ArraySegment<Byte>)

Creates a new Secret from the provided input value, where the input value is specified as an array segment.

Secret(Byte*, Int32)

Creates a new Secret from the provided input value, where the input value is specified as a pointer to unmanaged memory.

Secret(Byte[])

Creates a new Secret from the provided input value, where the input value is specified as an array.

Secret(ISecret)

Creates a new Secret from another secret object.

Properties

Length

The length (in bytes) of the secret value.

Methods

Dispose()

Wipes the secret from memory.

Random(Int32)

Returns a Secret made entirely of random bytes retrieved from a cryptographically secure RNG.

WriteSecretIntoBuffer(ArraySegment<Byte>)

Writes the secret value to the specified buffer.

WriteSecretIntoBuffer(Byte*, Int32)

Writes the secret value to the specified buffer.

Applies to