SharedSecret Class

Represents the output of a key agreement and the input for key derivation.

public sealed class SharedSecret : IDisposable

Properties

Size

Gets the size, in bytes, of the shared secret.

public int Size { get; }

Property Value

The size, in bytes, of the shared secret.

Static Methods

Import(ReadOnlySpan<byte>, in SharedSecretCreationParameters)

Imports the specified shared secret.

public static SharedSecret Import(
    ReadOnlySpan<byte> sharedSecret,
    in SharedSecretCreationParameters creationParameters = default)

Parameters

sharedSecret
The shared secret to import.
creationParameters
A SharedSecretCreationParameters value that specifies advanced parameters for the creation of the SharedSecret instance.

Return Value

A new instance of the SharedSecret class that represents the imported shared secret.

Exceptions

ArgumentException
The length of sharedSecret is greater than 128.

Methods

Dispose()

Securely erases the shared secret from memory and releases all resources used by the current instance of the SharedSecret class.

public void Dispose()

Thread Safety

Any public static members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also