Documentation
¶
Overview ¶
Package signer holds the service's signing keys behind crypto.Signer and the public key material it publishes. Production keys live in a KMS; development keys are generated on first start and stored in the database.
Index ¶
- func AddKey(root crypto.Signer, list []byte, kid string, pub crypto.PublicKey, ...) ([]byte, error)
- func CertPEM(c *x509.Certificate) []byte
- func KeyPEM(k crypto.Signer) ([]byte, error)
- func MarkCompromised(root crypto.Signer, list []byte, kid string, at, now time.Time) ([]byte, error)
- func ParseCerts(b []byte) ([]*x509.Certificate, error)
- func ParseKey(b []byte) (crypto.Signer, error)
- func Publish(ctx context.Context, st storage.Store, p *Published) error
- func SamePublic(a, b crypto.PublicKey) bool
- func Secret(ctx context.Context, st storage.Store) ([]byte, error)
- type Keys
- type Published
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddKey ¶
func AddKey(root crypto.Signer, list []byte, kid string, pub crypto.PublicKey, now time.Time, overlap time.Duration) ([]byte, error)
AddKey returns list (nil starts a new one) re-signed by root with pub added as the active key kid. Keys active until now are retired with not_after = now + overlap, which leaves time to deploy the new key. They stay listed, so earlier evidence keeps verifying.
func MarkCompromised ¶
func MarkCompromised(root crypto.Signer, list []byte, kid string, at, now time.Time) ([]byte, error)
MarkCompromised returns list re-signed by root with kid marked compromised from at. Evidence timestamped before at remains assessable; later evidence signed with kid fails verification.
func ParseCerts ¶
func ParseCerts(b []byte) ([]*x509.Certificate, error)
ParseCerts reads one or more PEM certificates.
func SamePublic ¶
SamePublic reports whether two public keys are equal.
Types ¶
type Keys ¶
type Keys struct {
// Seal signs the PDF seal; its public key is SealChain[0]'s.
Seal crypto.Signer
// SealChain is the seal certificate followed by its intermediates.
SealChain []*x509.Certificate
// Evidence signs evidence packages.
Evidence crypto.Signer
// EvidenceKID is the key-list ID of Evidence.
EvidenceKID string
// KeyList is the signed key list served at /.well-known/inkless/keys.json.
KeyList []byte
// RootThumbprint is the thumbprint of the key that signed KeyList.
RootThumbprint string
// SealRoots and TSARoots are the trust anchors for the seal and timestamp
// chains; nil when none are published.
SealRoots, TSARoots *x509.CertPool
// DevTSA is set only for development keys.
DevTSA *devpki.Cert
}
Keys is everything the service signs with, plus the public trust data it serves and uses for POST /v1/verify.
func Dev ¶
Dev returns development keys, generating and storing a synthetic key set on first use. They must never be used in production.
type Published ¶
type Published struct {
// KeyList is the signed key list JSON.
KeyList []byte
// SealChain is the PEM seal certificate followed by its intermediates.
SealChain []byte
// SealRoots and TSARoots are PEM trust anchors.
SealRoots, TSARoots []byte
}
Published is the public key material stored in the database.