Help us shape the future of Go! Take the 2026 Go Developer Survey

sign

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package sign holds a box's keys: its identity, which signs certificates and revocations and nothing else, and its working keys, which sign what the box says (PROTOCOL.md §5). Nothing else in the client signs with them (TestOnlySignSigns), and every signature first asks whether the box holds its own revocation, and is refused if it does (PROTOCOL.md §12.5): no path, a new one included, can sign around that check.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Finished

type Finished func() error

Finished returns why the box may sign nothing more, or nil.

type Identity

type Identity struct {
	// contains filtered or unexported fields
}

Identity is a box's identity key.

func NewIdentity

func NewIdentity(key ssh.Signer, finished Finished) *Identity

NewIdentity holds key, the box's identity, for a box that says whether it is finished.

func (*Identity) Certify

func (k *Identity) Certify(id *protocol.Identity, work ssh.PublicKey, n uint64, now time.Time) (*protocol.Certificate, error)

Certify signs a certificate of the working key work, of serial n, made at now (protocol.NewCertificate).

func (*Identity) PublicKey

func (k *Identity) PublicKey() ssh.PublicKey

PublicKey is the identity's public key.

func (*Identity) Revocation

func (k *Identity) Revocation(a protocol.Address) ([]byte, error)

Revocation signs the revocation of the address a (protocol.SignRevocation).

func (*Identity) RevokedCertificates

func (k *Identity) RevokedCertificates(r *protocol.RevokedCertificates) ([]byte, error)

RevokedCertificates signs the revocation of certificates r (protocol.SignRevokedCertificates).

type Work

type Work struct {
	// contains filtered or unexported fields
}

Work is a working key, under its certificate.

func NewWork

func NewWork(key ssh.Signer, finished Finished) *Work

NewWork holds key, a working key under its certificate, for a box that says whether it is finished.

func (*Work) Pass

func (k *Work) Pass(a protocol.Address, server string, now time.Time) (string, time.Time, error)

Pass signs a pass of the box a, for the server named server, dated now (protocol.NewPass).

func (*Work) Signature

func (k *Work) Signature(message []byte, namespace string) ([]byte, error)

Signature signs message in namespace (protocol.Sign): a prekey statement, or mail.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL