Documentation ¶
Index ¶
- Constants
- func CSVToSlice(c string) []string
- func FmtDN(o observatory.Organization) string
- func FmtMultivaluedRDN(rdn []string) string
- func FmtRDN(rdn string) string
- func MapAlgorithm(key observatory.Key) string
- func MapArray(a string) string
- func MapCRLs(c []string) string
- func MapExtendedKeyUsage(extendedKeyUsage string) string
- func MapSignature(signature string) string
- func MapTechnicallyConstrained(t string) string
- func MapTime(t time.Time) string
- func NormalizeIntermediate(intermediate ccadb.Certificate) *ccadb.Certificate
- func NormalizeRoot(root ccadb.Certificate) *ccadb.Certificate
- func SliceToCSV(s []string) string
- func StripColons(s string) string
- func StripPEM(p string) string
Constants ¶
const ( // AllowLDAPCRLs determines whether or not to allow LDAP CR endpoints // into the CRL. Defaults to false. AllowLDAPCRLs = false )
const (
// EmptyArray is the CCADB's chosen representation of an empty collection.
EmptyArray = "(not present)"
)
Variables ¶
This section is empty.
Functions ¶
func CSVToSlice ¶
CSVToSlice parses the provided CSV into a slice of strings.
func FmtDN ¶
func FmtDN(o observatory.Organization) string
FmtDN formats the provide Organization struct into a single distinguished name string using the format "CN=%v, OU=%v, O=%v, C=%v". The distinguished name is constructed using the rules found at RFC1779 (https://tools.ietf.org/html/rfc1779). Double quotes are used as the escape mechanism, except in the case of double quotes themselves, which are escaped using a `\`. Refer to the following BNF outlined in section 2.3.
<name> ::= <name-component> ( <spaced-separator> ) | <name-component> <spaced-separator> <name> <spaced-separator> ::= <optional-space> <separator> <optional-space> <separator> ::= "," | ";" <optional-space> ::= ( <CR> ) *( " " ) <name-component> ::= <attribute> | <attribute> <optional-space> "+" <optional-space> <name-component> <attribute> ::= <string> | <key> <optional-space> "=" <optional-space> <string> <key> ::= 1*( <keychar> ) | "OID." <oid> | "oid." <oid> <keychar> ::= letters, numbers, and space <oid> ::= <digitstring> | <digitstring> "." <oid> <digitstring> ::= 1*<digit> <digit> ::= digits 0-9 <string> ::= *( <stringchar> | <pair> ) | '"' *( <stringchar> | <special> | <pair> ) '"' | "#" <hex> <special> ::= "," | "=" | <CR> | "+" | "<" | ">" | "#" | ";" <pair> ::= "\" ( <special> | "\" | '"') <stringchar> ::= any character except <special> or "\" or '"' <hex> ::= 2*<hexchar> <hexchar> ::= 0-9, a-f, A-F
func FmtMultivaluedRDN ¶
FmtMultivaluedRDN performs any necessary escaping and concatenation of the provided string in order to make it a valid RDN field.
It returns the STRING "null" (not the null singleton) if the provided string is empty.
func FmtRDN ¶
FmtRDN performs any necessary escaping of the provided string in order to make it a valid RDN field.
It returns the STRING "null" (not the null singleton) if the provided string is empty.
func MapAlgorithm ¶
func MapAlgorithm(key observatory.Key) string
MapAlgorithm maps the public key algorithm name from the CCADB format to the TLS Observatory's format.
func MapArray ¶
MapArray transforms the string representation of a CCADB array to the string representation of a TLS Observatory array.
func MapCRLs ¶
MapCRLs trims the whitespace of each CR endpoint in the provided slice. If AllowLDAPCRLs is set to false, then LDAP CR endpoints are filtered from the return.
Returns the slice translated to a CSV string.
func MapExtendedKeyUsage ¶
MapExtendedKeyUsage transforms the CCADB EKU format and naming to the TLS Observatory's format and naming.
func MapSignature ¶
MapSignature maps the string describing the certificate's signature hash and encryption algorithm from the CCADB's enum set to the TLS Observatory's enum set.
func MapTechnicallyConstrained ¶
MapTechnicallyConstrained maps the strings "false" and "true" to the strings "0" and "1", respectively.
func MapTime ¶
MapTime returns the string format of the provided Time using the TLS Observatory's time format.
func NormalizeIntermediate ¶
func NormalizeIntermediate(intermediate ccadb.Certificate) *ccadb.Certificate
NormalizeIntermediate transforms the given CCADB intermediate certificate into the same formatting and style used by the TLS Observatory.
func NormalizeRoot ¶
func NormalizeRoot(root ccadb.Certificate) *ccadb.Certificate
NormalizeRoot transforms the given CCADB root certificate into the same formatting and style used by the TLS Observatory.
func SliceToCSV ¶
SliceToCSV constructs a CSV string from the provided string slice.
func StripColons ¶
StripColons removes all colons. Typically from fingerprints.
Types ¶
This section is empty.