Table of Contents

Class SshAllowedSigners

Namespace
SshSharp
Assembly
SshSharp.dll

An allowed-signers file (ssh-keygen's ALLOWED SIGNERS format, git's gpg.ssh.allowedSignersFile): which keys may sign as which principals, for SshSignature verification as ssh-keygen -Y verify and -Y find-principals do.

public sealed class SshAllowedSigners
Inheritance
SshAllowedSigners
Inherited Members

Remarks

Each line is principals [options] keytype base64 [comment]. The principals are a comma-separated list of patterns (*, ?, ! to exclude; case-sensitive). The options are cert-authority (the key is a certificate authority, and a signature by any user certificate it issued for the principal is accepted), namespaces="git,file" (patterns, too), and valid-after / valid-before (YYYYMMDD[HHMM[SS]], with a trailing Z for UTC, otherwise local time). An unknown or repeated option rejects the file, as in ssh-keygen.

Properties

Count

How many signers (lines) the file has.

Methods

FindPrincipals(SshSignature, DateTimeOffset?)

The principals this file allows the signature's key to sign as, at time (now by default), as ssh-keygen -Y find-principals prints them. Like ssh-keygen, it answers from the first line that matches: a plain key's line gives its principal patterns; for a certificate, a cert-authority line for its authority gives the certificate's principals that the line allows. Empty when no line matches. It does not check the signature itself.

LoadAsync(string, CancellationToken)

Reads and parses an allowed-signers file.

Parse(string)

Parses an allowed-signers file's contents; blank lines and lines starting with # are skipped.

Verify(SshSignature, string, ReadOnlySpan<byte>, string, DateTimeOffset?)

Whether signature is a valid signature over message, for namespace, by a key this file allows to sign as principal at time (now by default), as ssh-keygen -Y verify -I principal -n namespace checks.

VerifyAsync(SshSignature, string, Stream, string, DateTimeOffset?, CancellationToken)

Like Verify(SshSignature, string, ReadOnlySpan<byte>, string, DateTimeOffset?), over what message reads to its end.