Table of Contents

Class TofuServerIdentityVerifier

Namespace
BSGameLib.Networking
Assembly
BSGameLib.Networking.dll

Default IServerIdentityVerifier: trust-on-first-use fingerprint pinning backed by a local JSON file, keyed by whatever serverKey the caller uses to identify a server (e.g. "host:port"). See docs/quic-connection-authentication.md.

public sealed class TofuServerIdentityVerifier : IServerIdentityVerifier
Inheritance
TofuServerIdentityVerifier
Implements
Inherited Members

Constructors

TofuServerIdentityVerifier(IFileSystem, string)

Creates a verifier that keeps its fingerprints in the file at storeFilePath, read and written through fileSystem.

public TofuServerIdentityVerifier(IFileSystem fileSystem, string storeFilePath)

Parameters

fileSystem IFileSystem
storeFilePath string

TofuServerIdentityVerifier(string)

Creates a verifier that keeps the fingerprints it trusts in the JSON file at storeFilePath.

public TofuServerIdentityVerifier(string storeFilePath)

Parameters

storeFilePath string

Methods

GetExpectedFingerprint(string)

Returns the fingerprint pinned for serverKey, or null when none is pinned.

public string GetExpectedFingerprint(string serverKey)

Parameters

serverKey string

Returns

string

OnFingerprintObserved(string, string, bool)

Records fingerprint for serverKey when it matched the expected fingerprint, or when none was pinned yet. A fingerprint that did not match is not recorded, so a changed identity never replaces a pinned one.

public void OnFingerprintObserved(string serverKey, string fingerprint, bool matchedExpected)

Parameters

serverKey string
fingerprint string
matchedExpected bool