Versions in this module Expand all Collapse all v0 v0.3.0 Oct 4, 2026 v0.2.0 Oct 2, 2026 v0.1.0 Sep 29, 2026 Changes in this version + var ErrAmbiguous = errors.New("ambiguous identifier") + var ErrIntegrity = errors.New(...) + var ErrNotFound = errors.New("not found") + func CAKey(dn string) string + func EscapeLike(s string) string + func Exists(path string) bool + func IsNotFound(err error) bool + func KeyFilePath(dbPath string) string + func NameSetKey(names []string) string + func NormalizeDN(dn string) string + func NormalizeSerial(s string) string + func NormalizeTag(tag string) (string, error) + type CTObservation struct + Acknowledged bool + CertSHA256 string + DNSNames []string + ExternalID string + FirstSeen time.Time + ID string + Identity string + Issuer string + IssuerName string + KnownCertID string + NotAfter time.Time + NotBefore time.Time + Provider string + PubkeySHA256 string + Reason string + Revoked *bool + Serial string + Status string + WatchID string + type CTObservationFilter struct + Limit int + Since time.Time + Status string + WatchIDs []string + type CTWatch struct + CreatedAt time.Time + Cursor string + Domain string + ID string + IncludeSubdomains bool + LastCheckedAt time.Time + Source string + func (w CTWatch) Pattern() string + type CertIndex struct + BySHA256 map[string]string + BySPKI map[string]string + BySerial map[string]string + Issuers map[string]bool + NameSets map[string]string + SANs []string + type Certificate struct + AuthorityKeyID string + CTMonitored bool + Comment string + DER []byte + ID string + ImportedAt time.Time + IsCA bool + Issuer string + IssuerCN string + IssuerID string + KeyAlgorithm string + KeyBits int + KeyDescription string + KeyID string + Name string + NotAfter time.Time + NotBefore time.Time + SANs []SAN + SHA1 string + SHA256 string + SPKISHA256 string + SelfSigned bool + Serial string + SignatureAlgorithm string + Source string + Subject string + SubjectCN string + SubjectKeyID string + Tags []string + type DB struct + func Create(ctx context.Context, path string, root []byte) (*DB, error) + func Open(ctx context.Context, path string, root []byte) (*DB, error) + func (db *DB) AcknowledgeCTObservation(ctx context.Context, ref string) (string, error) + func (db *DB) AddCTWatch(ctx context.Context, domain string, subdomains bool, source string) (*CTWatch, bool, error) + func (db *DB) AddNote(ctx context.Context, objType, id, body string) (*Note, error) + func (db *DB) AddTags(ctx context.Context, objType, id string, tags []string) error + func (db *DB) AllTags(ctx context.Context) (map[string]int, error) + func (db *DB) AttachPrivate(ctx context.Context, tx *sql.Tx, keyID string, private []byte) error + func (db *DB) AttachSSHPrivate(ctx context.Context, id string, private []byte, passphraseProtected bool) error + func (db *DB) CTCertIndex(ctx context.Context) (*CertIndex, error) + func (db *DB) CTObservations(ctx context.Context, f CTObservationFilter) ([]CTObservation, error) + func (db *DB) CTWatches(ctx context.Context) ([]CTWatch, error) + func (db *DB) CTWatchesFor(ctx context.Context, domain string) ([]CTWatch, error) + func (db *DB) CertificateBySHA256(ctx context.Context, sha string) (*Certificate, error) + func (db *DB) Close() error + func (db *DB) CountCTObservations(ctx context.Context, status string, since time.Time) (int, error) + func (db *DB) CountCertificates(ctx context.Context) (int, error) + func (db *DB) CountEndpoints(ctx context.Context) (int, error) + func (db *DB) DeleteCTWatch(ctx context.Context, id string) error + func (db *DB) DeleteCertificate(ctx context.Context, id string) error + func (db *DB) DeleteKey(ctx context.Context, id string) error + func (db *DB) DeleteSSHKey(ctx context.Context, id string) error + func (db *DB) Endpoints(ctx context.Context) ([]Endpoint, error) + func (db *DB) FindEndpoints(ctx context.Context, host string, port int) ([]Endpoint, error) + func (db *DB) ForgetRemote(ctx context.Context, remote string) error + func (db *DB) GetCertificate(ctx context.Context, ref string) (*Certificate, error) + func (db *DB) GetKey(ctx context.Context, ref string) (*Key, error) + func (db *DB) GetSSHKey(ctx context.Context, ref string) (*SSHKey, error) + func (db *DB) GetScan(ctx context.Context, ref string) (*Scan, error) + func (db *DB) GetSecret(ctx context.Context, id string) ([]byte, error) + func (db *DB) GetSetting(ctx context.Context, key string) ([]byte, error) + func (db *DB) InsertCTObservation(ctx context.Context, o *CTObservation) (bool, error) + func (db *DB) InsertCertificate(ctx context.Context, tx *sql.Tx, c *Certificate) error + func (db *DB) InsertKey(ctx context.Context, tx *sql.Tx, k *Key, private []byte) error + func (db *DB) KeyBySPKI(ctx context.Context, spki string) (*Key, error) + func (db *DB) LinkCertificate(ctx context.Context, tx *sql.Tx, id, issuerID, keyID string) error + func (db *DB) MarkCTMonitored(ctx context.Context) error + func (db *DB) Notes(ctx context.Context, objType, id string) ([]Note, error) + func (db *DB) Path() string + func (db *DB) PrivateKeyDER(ctx context.Context, k *Key) ([]byte, error) + func (db *DB) PutNote(ctx context.Context, objType, id string, n Note) error + func (db *DB) PutSecret(ctx context.Context, tx *sql.Tx, plaintext []byte) (string, error) + func (db *DB) QueryCertificates(ctx context.Context, where string, args []any, order string) ([]*Certificate, error) + func (db *DB) QueryKeys(ctx context.Context, where string, args []any) ([]*Key, error) + func (db *DB) QuerySSHKeys(ctx context.Context, where string, args []any) ([]*SSHKey, error) + func (db *DB) RecentCertificates(ctx context.Context, limit int) ([]*Certificate, error) + func (db *DB) RecentScans(ctx context.Context, limit int, withResult bool) ([]RecentScan, error) + func (db *DB) RecordScan(ctx context.Context, ep Endpoint, s *Scan) error + func (db *DB) RemoveTags(ctx context.Context, objType, id string, tags []string) error + func (db *DB) ReplaceSyncStates(ctx context.Context, remote string, states map[SyncKey]string) error + func (db *DB) ResolveCertificate(ctx context.Context, ref string) (string, error) + func (db *DB) ResolveKey(ctx context.Context, ref string) (string, error) + func (db *DB) SQL() *sql.DB + func (db *DB) SSHPrivateKey(ctx context.Context, k *SSHKey) ([]byte, error) + func (db *DB) Scans(ctx context.Context, endpointID string, limit int, withResult bool) ([]Scan, error) + func (db *DB) SchemaVersion(ctx context.Context) (int, error) + func (db *DB) SetSetting(ctx context.Context, key string, value []byte, secret bool) error + func (db *DB) SyncStates(ctx context.Context, remote string) (map[SyncKey]string, error) + func (db *DB) TotalChanges(ctx context.Context) (int64, error) + func (db *DB) Tx(ctx context.Context, fn func(tx *sql.Tx) error) error + func (db *DB) UpdateCTWatchCheck(ctx context.Context, id, cursor string, at time.Time) error + func (db *DB) UpdateCertificateMeta(ctx context.Context, id string, name, comment *string) error + func (db *DB) UpdateKeyMeta(ctx context.Context, id string, name, comment *string) error + func (db *DB) UpdateSSHKeyMeta(ctx context.Context, id string, name, comment *string) error + func (db *DB) UpdateSSHKeyName(ctx context.Context, id, name string) error + func (db *DB) UpsertSSHKey(ctx context.Context, k *SSHKey, private []byte) (*SSHKey, bool, error) + type Endpoint struct + FirstSeen time.Time + Host string + ID string + LastSeen time.Time + Port int + Protocol string + SNI string + type Key struct + Algorithm string + Bits int + Comment string + Description string + ID string + ImportedAt time.Time + Name string + PublicDER []byte + SPKISHA256 string + SecretID string + Source string + Tags []string + func (k *Key) HasPrivate() bool + type Note struct + Body string + CreatedAt time.Time + ID string + type RecentScan struct + Host string + Port int + type SAN struct + Type string + Value string + type SSHKey struct + Bits int + Comment string + FingerprintSHA256 string + ID string + ImportedAt time.Time + Name string + PassphraseProtected bool + PublicKey string + SecretID string + Source string + Tags []string + Type string + func (k *SSHKey) HasPrivate() bool + type Scan struct + EndpointID string + ID string + Kind string + LeafSHA256 string + Result []byte + ScannedAt time.Time + Snapshot []byte + type SyncKey struct + Ident string + Kind string