Documentation
¶
Overview ¶
Package certinfo describes an X.509 certificate's public metadata: identity, validity, key algorithm and size, signature algorithm, names and flags.
It is the single place these facts are worked out. The TLS scanner (a certificate a server presented) and the host certificate sensors (a certificate a machine holds) both call it, so the same certificate yields the same attributes whichever way it was found, which is what lets the estate graph treat the two sightings as one entity.
It reads a parsed certificate and nothing else: no key material, no network, no operating system, no file. It has no way to describe a private key.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicConstraints ¶
BasicConstraints is the basicConstraints extension.
type Extension ¶ added in v0.3.0
Extension is one extension a certificate carries: its OID, whether it is critical, and the name this program decodes it by ("" when it does not decode it).
type Facts ¶
type Facts struct {
Subject string
Issuer string
SerialHex string
DNSNames []string
IPAddresses []string
NotBefore time.Time
NotAfter time.Time
IsCA bool
SelfSigned bool
SHA256 string // lower-case hex over the DER encoding: the certificate's identity
KeyUsage []string
KeyAlgorithm string // RSA, ECDSA, Ed25519, ... or "unknown"; never guessed
KeyOID string // the SubjectPublicKeyInfo algorithm OID
KeyBits int // 0 when the key size is not known
Curve string // named curve of an ECDSA key
SigName string
SigOID string
OCSPServers []string
IssuerURLs []string
CRLPoints []string
OCSPMustStaple bool
EmbeddedSCTs bool
SPKISHA256 string // lower-case hex over SubjectPublicKeyInfo: the key's identity across certificates
ExtKeyUsage []string // RFC 5280 names ("serverAuth"), or the OID for one without a name
BasicConstraints *BasicConstraints
NameConstraints *NameConstraints
Policies []string // certificate policy OIDs
PolicyClass string // DV, OV, IV or EV from the CA/Browser Forum policy OIDs; "unknown" otherwise
CNOnly bool // a subject CN and no subjectAltName at all
Wildcards []string // DNS SANs that are wildcards
LifetimeDays int // validity period in days, rounded up (notBefore and notAfter both inclusive)
RSAExponent int // public exponent of an RSA key, else 0
SigParams string // RSASSA-PSS parameters in words (RFC 8017 A.2.3), "" for other signatures
AuthorityKey string // authorityKeyIdentifier keyIdentifier, hex
SubjectKey string // subjectKeyIdentifier, hex
Extensions []Extension // every extension, by OID, decoded or not
}
Facts is what a certificate says about itself. Text fields come from the certificate and are attacker-controlled: callers clean and bound them before they travel further.
type NameConstraints ¶
NameConstraints is the nameConstraints extension, flattened to strings.