Documentation ¶
Index ¶
- func EncodeTLSToObject(t *tls.ConnectionState) interface{}
- func EncodeTLSToText(tcs *tls.ConnectionState) string
- func EncodeX509ToJSON(cert *x509.Certificate) []byte
- func EncodeX509ToObject(cert *x509.Certificate) interface{}
- func EncodeX509ToPEM(cert *x509.Certificate, headers map[string]string) *pem.Block
- func EncodeX509ToText(cert *x509.Certificate, terminalWidth int, verbose bool) []byte
- func IsSelfSigned(cert *x509.Certificate) bool
- func ReadAsPEM(readers []io.Reader, format string, password func(string) string, ...) error
- func ReadAsPEMFromFiles(files []*os.File, format string, password func(string) string, ...) error
- func ReadAsX509(readers []io.Reader, format string, password func(string) string, ...) error
- func ReadAsX509FromFiles(files []*os.File, format string, password func(string) string, ...) error
- type OidDescription
- type TLSDescription
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeTLSToObject ¶ added in v1.7.0
func EncodeTLSToObject(t *tls.ConnectionState) interface{}
EncodeTLSToObject returns a JSON-marshallable description of a TLS connection
func EncodeTLSToText ¶ added in v1.7.0
func EncodeTLSToText(tcs *tls.ConnectionState) string
EncodeTLSToText returns a human readable string, suitable for certigo console output.
func EncodeX509ToJSON ¶
func EncodeX509ToJSON(cert *x509.Certificate) []byte
EncodeX509ToJSON encodes an X.509 certificate into a JSON string.
func EncodeX509ToObject ¶
func EncodeX509ToObject(cert *x509.Certificate) interface{}
EncodeX509ToObject encodes an X.509 certificate into a JSON-serializable object.
func EncodeX509ToPEM ¶
EncodeX509ToPEM converts an X.509 certificate into a PEM block for output.
func EncodeX509ToText ¶
func EncodeX509ToText(cert *x509.Certificate, terminalWidth int, verbose bool) []byte
EncodeX509ToText encodes an X.509 certificate into human-readable text.
func IsSelfSigned ¶
func IsSelfSigned(cert *x509.Certificate) bool
IsSelfSigned returns true iff the given certificate has a valid self-signature.
func ReadAsPEM ¶
func ReadAsPEM(readers []io.Reader, format string, password func(string) string, callback func(*pem.Block)) error
ReadAsPEM will read PEM blocks from the given set of inputs. Input data may be in plain-text PEM files, DER-encoded certificates or PKCS7 envelopes, or PKCS12/JCEKS keystores. All inputs will be converted to PEM blocks and passed to the callback.
func ReadAsPEMFromFiles ¶
func ReadAsPEMFromFiles(files []*os.File, format string, password func(string) string, callback func(*pem.Block)) error
ReadAsPEMFromFiles will read PEM blocks from the given set of inputs. Input data may be in plain-text PEM files, DER-encoded certificates or PKCS7 envelopes, or PKCS12/JCEKS keystores. All inputs will be converted to PEM blocks and passed to the callback.
func ReadAsX509 ¶
func ReadAsX509(readers []io.Reader, format string, password func(string) string, callback func(*x509.Certificate)) error
ReadAsX509 will read X.509 certificates from the given set of inputs. Input data may be in plain-text PEM files, DER-encoded certificates or PKCS7 envelopes, or PKCS12/JCEKS keystores. All inputs will be converted to X.509 certificates (private keys are skipped) and passed to the callback.
func ReadAsX509FromFiles ¶
func ReadAsX509FromFiles(files []*os.File, format string, password func(string) string, callback func(*x509.Certificate)) error
ReadAsX509FromFiles will read X.509 certificates from the given set of inputs. Input data may be in plain-text PEM files, DER-encoded certificates or PKCS7 envelopes, or PKCS12/JCEKS keystores. All inputs will be converted to X.509 certificates (private keys are skipped) and passed to the callback.
Types ¶
type OidDescription ¶ added in v1.6.0
OidDescription returns a human-readable name, a short acronym from RFC1485, a snake_case slug suitable as a json key, and a boolean describing whether multiple copies can appear on an X509 cert.
type TLSDescription ¶ added in v1.7.0
TLSDescription has the basic information about a TLS connection