Documentation
¶
Index ¶
Constants ¶
const ( BEGIN = "-----BEGIN CERTIFICATE-----\n" END = "-----END CERTIFICATE-----" WIDTH = 64 // Columns per line https://tools.ietf.org/html/rfc1421 )
Certificate normalization constants.
Variables ¶
This section is empty.
Functions ¶
func MapPairs ¶
MapPairs map all of the entries in certdata.txt to entries in the CCADB report. Entries are matched together if they:
- Have the same serial number (normalized for leading zeroes) or
- They have the exact same PEM. or
- They have the exact same Common Name.
Any entries for which a mapping could not be made are returned in the 'rest' slice.
func NormalizePEM ¶
normalizePEM ignores any formatting or string artifacts that the PEM may have had and applies https://tools.ietf.org/html/rfc1421
This stemmed from noticing that CCADB reports were fully formed while certdata PEMS had no formatting nor BEGIN/END fields. This is simply avoiding any surprises in individual formatting choices by forcing both to strip all formatting and conform to the one, chosen, way.
Types ¶
type Entry ¶
type Entry struct { OrganizationName string `json:"organizationName"` OrganizationalUnitName string `json:"organizationalUnitName"` CommonName string `json:"commonName"` SerialNumber string `json:"serialNumber"` PEM string `json:"-"` Fingerprint string `json:"sha256"` TrustWeb bool `json:"trustWeb"` TrustEmail bool `json:"trustEmail"` LineNumber int `json:"lineNumber"` Origin string `json:"origin"` }
Entry is a normalized form of a Certificate Authority found in either certdata.txt or from a CCADB report CSV.
func NewEntry ¶
func NewEntry(org, orgUnit, commonName, serial, pem, fingerprint string, trustWeb, trustEmail bool, line int, origin string) *Entry
NewEntry constructs a new Entry with a normalized PEM.
func (*Entry) DistinguishedName ¶
DistinguishedName builds a hierarchical string of Organization, Orgizational Unit, and Common Name.
func (*Entry) NormalizedSerial ¶
NormalizedSerial returns the serial number with any leading zeroes stripped off.