Documentation
¶
Overview ¶
Package sig verifies OpenPGP and SSHSIG signatures on git commits and tags, and maps them to the forge's trust states.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Commit ¶
type Commit struct {
Raw []byte
Payload []byte // Raw with the gpgsig header removed, byte-exact
Signature []byte // armored signature block, nil if unsigned
AuthorName string
AuthorEmail string
CommitterEmail string
Subject string
AuthorUnix int64
}
Commit is a parsed raw commit object.
func ParseCommit ¶
ParseCommit splits a raw commit object (as printed by `git cat-file commit`) into its signed payload and signature. The payload must be byte-exact: it is the original object minus the gpgsig header line and its continuation lines, nothing else.
type DB ¶
type DB interface {
// PGPKeyByIssuer finds a registered key whose fingerprint ends with the
// issuer key id (16 hex chars, lowercase).
PGPKeyByIssuer(keyIDHex string) (PGPKeyInfo, string, bool, error) // info, fingerprint, found
SSHSignerByFingerprint(fp string) (SSHKeyInfo, bool, error)
VerifiedEmails(userID int64) ([]string, error)
}
DB is the store surface the verifier depends on. Implemented by store.SigDB.
type PGPKeyInfo ¶
PGPKeyInfo is a registered OpenPGP key as the verifier needs it.
type PGPKeyMeta ¶
type PGPKeyMeta struct {
Fingerprint string // primary key, lowercase hex
Emails []string
ExpiresAt *time.Time
RevokedAt *time.Time
}
PGPKeyMeta is what `pgp add` needs to persist about an imported key.
func ParsePGPKey ¶
func ParsePGPKey(armored []byte) (PGPKeyMeta, error)
ParsePGPKey extracts registration metadata from an armored public key.
type Result ¶
type SSHKeyInfo ¶
SSHKeyInfo is a registered SSH key as the verifier needs it.
Source Files
¶
- commit.go
- keys.go
- sshsig.go
- verify.go