Documentation
¶
Index ¶
- Constants
- func DecodeDER(octal string) (string, string, error)
- func DecodeIssuer(octal string) (pkix.RDNSequence, error)
- func DecodeSerialNumber(octal string) (string, error)
- func Extract(b *bufio.Reader, start int, distrust bool, fname string) (*utils.Entry, int, error)
- func ExtractMultilineOctal(b *bufio.Reader) (string, int)
- func FmtFingerprint(h string) string
- func NewEntry(i pkix.RDNSequence, s string, pem string, hash string, ...) *utils.Entry
- func ParseToNormalizedForm(f io.Reader) ([]*utils.Entry, error)
Constants ¶
const ( URL = "https://hg.mozilla.org/releases/mozilla-beta/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt" StartCertificate = "CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE" // Declaration of start of Certificate object. StartTrust = "CKA_CLASS CK_OBJECT_CLASS CKO_NSS_TRUST" // Declaration of start of a Distrust object. WebDistrust = "CKA_TRUST_SERVER_AUTH CK_TRUST (CKT_NSS_MUST_VERIFY_TRUST|CKT_NSS_NOT_TRUSTED)" WebTrust = "CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_TRUSTED_DELEGATOR" EmailDistrust = "CKA_TRUST_EMAIL_PROTECTION CK_TRUST (CKT_NSS_MUST_VERIFY_TRUST|CKT_NSS_NOT_TRUSTED)" EmailTrust = "CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_TRUSTED_DELEGATOR" IssuerPrefix = "CKA_ISSUER MULTILINE_OCTAL" // Declaration of start of a CKA_ISSUER block SerialNumberPrefix = "CKA_SERIAL_NUMBER MULTILINE_OCTAL" // Declaration of start of a CKA_SERIAL_NUMBER block. PEMPrefix = "CKA_VALUE MULTILINE_OCTAL" // Declaration of start a CKA_VALUE (PEM) block. )
Strings that mark the beginning of blocks of text important for parsing certdata.txt.
Variables ¶
This section is empty.
Functions ¶
func DecodeDER ¶
DecodeDER takes a DER encoded octal string and returns the base64 encoded certificate as well as its SHA-256 hash. No newlines, BEGIN, or END fields are present on the decoded string.
func DecodeIssuer ¶
func DecodeIssuer(octal string) (pkix.RDNSequence, error)
DecodeIssuer parses the CKA_ISSUER MULTILINE_OCTAL field of certdata.txt.
func DecodeSerialNumber ¶
DecodeSerialNumber takes a DER encoded octal string and returns the base64 encoded serial number.
func Extract ¶
Extract extracts the entity from the bufio.Reader, 'b', that starts line number 'start'. 'distrust' is whether or not the entity is a distrust object. This is necessary since distrust objects do not have a PEM to parse out.
func ExtractMultilineOctal ¶
ExtractMultilineOctal consumes the provided bufio.Reader and returns a string of '\' delimited octal values and then number of lines consumed to extract the octal value.
func FmtFingerprint ¶
FmtFingerprint formats a SHA 256 hash with colons.
func NewEntry ¶
func NewEntry(i pkix.RDNSequence, s string, pem string, hash string, webTrust, emailTrust bool, ln int, fname string) *utils.Entry
NewEntry constructs a new utils.Entry from the parsed ASN.1 issuer field, the serial number as a hex a string, the PEM as a base64 encoded string, the line number where entry started on, and the absolute path to the file where the entity was extracted from.
Types ¶
This section is empty.