Versions in this module Expand all Collapse all v0 v0.3.0 Nov 27, 2026 Changes in this version + const CertNotMade + const CertOK + const ControllerKeyStateKey + const EnrollRequestSuffix + const EnrollResponsePrefix + const JoinRequestSuffix + const NATSCertStateKey + const RenewRequestSuffix + const RotateRequestSuffix + var EncryptionKeyEncoding = base64.RawURLEncoding + var ErrNoKeys = errors.New("the keys are not on this host") + func CertFingerprint(pemData []byte) string + func CertState(err error) string + func EncodeEncryptionKey(pub *ecdh.PublicKey) string + func FingerprintOf(pubKey ed25519.PublicKey) string + func FingerprintOfKeys(signingKey ed25519.PublicKey, encryptionKey string) string + func ParseEncryptionKey(key string) (*ecdh.PublicKey, error) + func ParseEncryptionKeyFile(data []byte) (*ecdh.PrivateKey, error) + func ParsePublicKeyPEM(pemData []byte) (ed25519.PublicKey, error) + func ValidEncryptionKey(key string) bool + type Cert struct + Component string + DaysLeft *int + Expires time.Time + FIPS *bool + File string + Fingerprint string + Key string + Name string + Names []string + Signature string + Source string + State string + func ReadCert(fsys avfs.VFS, src CertSource, now time.Time) (Cert, error) + func ReadCerts(fsys avfs.VFS, srcs []CertSource, now time.Time) []Cert + type CertRecord struct + Current []byte + Name string + Next []byte + Serial uint64 + Signature []byte + StartedAt string + func (r *CertRecord) Sign(priv ed25519.PrivateKey) + func (r CertRecord) Rotating() bool + func (r CertRecord) SignedWith(verify func(data []byte, signature []byte) bool) bool + type CertSource struct + CertFile string + Component string + KeyFile string + Name string + SelfSigned bool + type ControllerKeyRecord struct + Current []byte + Next []byte + Previous []byte + Serial uint64 + Signature []byte + StartedAt time.Time + SwitchedAt time.Time + func (r *ControllerKeyRecord) Sign(priv ed25519.PrivateKey) + func (r ControllerKeyRecord) Rotating() bool + func (r ControllerKeyRecord) SignedBy(pub ed25519.PublicKey) bool + type EnrollmentRequest struct + EncryptionKey string + Fingerprint string + Hostname string + MachineID string + PublicKey []byte + type EnrollmentResponse struct + Accepted bool + ControllerPublicKey []byte + Reason string + type JoinNATS struct + Callout bool + JWT string + Password string + Username string + type JoinReply struct + ControllerPublicKey ed25519.PublicKey + Error string + Labels map[string]string + NATS JoinNATS + type JoinRequest struct + EncryptionKey string + Hostname string + MachineID string + NATSUserKey string + PublicKey ed25519.PublicKey + Signature []byte + Token string + func (r *JoinRequest) Sign(priv ed25519.PrivateKey) + func (r JoinRequest) Verify() bool + type Manager struct + func New(fs avfs.VFS, keyDir string, keyPrefix string, opts ...Option) *Manager + func (m *Manager) ControllerPublicKey() ed25519.PublicKey + func (m *Manager) Drop() error + func (m *Manager) EncryptionKey() *ecdh.PrivateKey + func (m *Manager) EncryptionPublicKey() string + func (m *Manager) Fingerprint() string + func (m *Manager) Load() error + func (m *Manager) LoadOrGenerate() error + func (m *Manager) Next() (*Manager, error) + func (m *Manager) NextControllerPublicKey() ed25519.PublicKey + func (m *Manager) PreviousControllerPublicKey() ed25519.PublicKey + func (m *Manager) PreviousEncryptionKey() *ecdh.PrivateKey + func (m *Manager) PrivateKey() ed25519.PrivateKey + func (m *Manager) Promote(next *Manager) error + func (m *Manager) PublicKey() ed25519.PublicKey + func (m *Manager) Reload() (bool, error) + func (m *Manager) RotateControllerKey(newKey ed25519.PublicKey) + func (m *Manager) SetControllerPublicKey(key ed25519.PublicKey) + func (m *Manager) SetNextControllerPublicKey(key ed25519.PublicKey) + func (m *Manager) SetPreviousControllerPublicKey(key ed25519.PublicKey) + func (m *Manager) Sign(data []byte) []byte + func (m *Manager) VerifyWithGrace(data []byte, signature []byte) bool + type Option func(*Manager) + func WithEncryptionKey() Option + type RenewRequest struct + At int64 + MachineID string + NATSUserKey string + Signature []byte + func (r *RenewRequest) Sign(priv ed25519.PrivateKey) + func (r RenewRequest) Verify(pub ed25519.PublicKey) bool + type RotateReply struct + Error string + Fingerprint string + type RotateRequest struct + At int64 + EncryptionKey string + MachineID string + NewSignature []byte + PublicKey ed25519.PublicKey + Signature []byte + func (r *RotateRequest) Sign(current ed25519.PrivateKey, next ed25519.PrivateKey) + func (r RotateRequest) Verify(pub ed25519.PublicKey) bool + func (r RotateRequest) VerifyNew() bool