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

sign

package
v0.3.1 Latest Latest
Warning

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

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

Documentation

Overview

Package sign holds a mailbox's keys, and is the one place they sign (TestOnlySignSigns). The identity signs whatever the mailbox signs, at any time: its prekey statements, passes and messages, the certificates it gives working keys, and its revocations. A working key under a certificate the identity made signs statements, passes and messages (PROTOCOL.md §5).

Every signature asks the mailbox, at the moment it is made, whether it holds its own revocation, and is refused if it does (PROTOCOL.md §12.5): no path, a new one included, signs 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 mailbox may sign nothing more, or nil.

type Identity

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

Identity is a mailbox's identity key.

func NewIdentity

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

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

func (*Identity) Certify

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

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

func (*Identity) Message added in v0.3.0

func (k *Identity) Message(line []byte, to protocol.Address) ([]byte, error)

Message signs an envelope's line for its recipient to, in to's message namespace.

func (*Identity) Pass added in v0.3.0

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

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

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).

func (*Identity) Statement added in v0.3.0

func (k *Identity) Statement(p *protocol.Prekey) ([]byte, error)

Statement signs prekey statement p, in its mailbox's prekey namespace.

type Work

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

Work is a working key under its certificate: it signs the mailbox's prekey statements, passes and messages.

func NewWork

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

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

func (*Work) Message added in v0.3.0

func (k *Work) Message(line []byte, to protocol.Address) ([]byte, error)

Message signs an envelope's line for its recipient to, in to's message namespace.

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 mailbox a, for the server named server, dated now (protocol.NewPass).

func (*Work) Statement added in v0.3.0

func (k *Work) Statement(p *protocol.Prekey) ([]byte, error)

Statement signs prekey statement p, in its mailbox's prekey namespace.

Jump to

Keyboard shortcuts

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