Table of Contents

Class CertificateManager

Namespace
MarymoorStudios.Core.Rpc.Identity
Assembly
MarymoorStudios.Core.Rpc.Identity.dll

Manages the certificates that provide identity to others.

public abstract class CertificateManager : IDisposable, IAsyncDisposable
Inheritance
CertificateManager
Implements
Derived
Inherited Members

Constructors

CertificateManager()

protected CertificateManager()

Properties

ClientOptions

The TLS client options used to negotiate authentication parameters.

public abstract SslClientAuthenticationOptions ClientOptions { get; }

Property Value

SslClientAuthenticationOptions

Endorsements

Endorsements to support Identity.

public abstract EndorsementCollection Endorsements { get; }

Property Value

EndorsementCollection

Identity

The identity.

public abstract UserIdentity Identity { get; }

Property Value

UserIdentity

ServerOptions

The TLS server options used to negotiate authentication parameters.

public abstract SslServerAuthenticationOptions ServerOptions { get; }

Property Value

SslServerAuthenticationOptions

Methods

Dispose()

public void Dispose()

Dispose(bool)

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

DisposeAsync()

public ValueTask DisposeAsync()

Returns

ValueTask

DisposeAsyncCore()

protected virtual ValueTask DisposeAsyncCore()

Returns

ValueTask

TryAdmit(UserIdentity, IEnumerable<Endorsement>, DateTime)

Checks if the user can be admitted.

public abstract ValueTask<bool> TryAdmit(UserIdentity identity, IEnumerable<Endorsement> endorsements, DateTime timestamp)

Parameters

identity UserIdentity

The identity of the user to be admitted.

endorsements IEnumerable<Endorsement>

Endorsements that support the identity provided by identity.

timestamp DateTime

The timestamp.

Returns

ValueTask<bool>

True if the user should be admitted, false otherwise.

TryAdmit(X509Certificate, IEnumerable<Endorsement>, DateTime)

Checks if the user can be admitted.

public abstract ValueTask<(bool IsAdmitted, UserIdentity Identity)> TryAdmit(X509Certificate cert, IEnumerable<Endorsement> endorsements, DateTime timestamp)

Parameters

cert X509Certificate

The user's certificate.

endorsements IEnumerable<Endorsement>

Endorsements that support the identity provided by cert.

timestamp DateTime

The timestamp.

Returns

ValueTask<(bool IsAdmitted, UserIdentity Identity)>

(True, the admitted identity) if the user should be admitted, (false, undefined) otherwise.

TrySignData(ReadOnlySpan<byte>, out ReadOnlyMemory<byte>)

Signs data with the Identity private key.

public abstract bool TrySignData(ReadOnlySpan<byte> data, out ReadOnlyMemory<byte> signature)

Parameters

data ReadOnlySpan<byte>

The data to sign.

signature ReadOnlyMemory<byte>

The signature, if successful, undefined otherwise.

Returns

bool

True if successful, false otherwise.

ValidateData(ReadOnlySpan<byte>, ReadOnlySpan<byte>, ReadOnlySpan<byte>)

Validates a signature over the data.

public abstract bool ValidateData(ReadOnlySpan<byte> publicKey, ReadOnlySpan<byte> data, ReadOnlySpan<byte> signature)

Parameters

publicKey ReadOnlySpan<byte>

The public key whose private key was used to sign the data.

data ReadOnlySpan<byte>

The data that was signed.

signature ReadOnlySpan<byte>

The signature to validate.

Returns

bool

True if successful, false otherwise.