Documentation ¶
Index ¶
- func EncodeCRIToObject(cri *tls.CertificateRequestInfo) (interface{}, error)
- func EncodeTLSInfoToText(tcs *tls.ConnectionState, cri *tls.CertificateRequestInfo) string
- func EncodeTLSToObject(t *tls.ConnectionState) interface{}
- 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 PrintCommonName(name pkix.Name) (out string)
- func PrintShortName(name pkix.Name) (out string)
- 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 CertificateRequestInfo
- type OidDescription
- type TLSDescription
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeCRIToObject ¶ added in v1.9.0
func EncodeCRIToObject(cri *tls.CertificateRequestInfo) (interface{}, error)
EncodeCRIToObject returns a JSON-marshallable representation of a CertificateRequestInfo object.
func EncodeTLSInfoToText ¶ added in v1.9.0
func EncodeTLSInfoToText(tcs *tls.ConnectionState, cri *tls.CertificateRequestInfo) string
EncodeTLSInfoToText returns a human readable string, suitable for certigo console output.
func EncodeTLSToObject ¶ added in v1.7.0
func EncodeTLSToObject(t *tls.ConnectionState) interface{}
EncodeTLSToObject returns a JSON-marshallable description of a TLS connection
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 PrintCommonName ¶ added in v1.10.0
PrintCommonName prints the CN from a pkix.Name, or falls back to PrintShortName if CN is missing.
func PrintShortName ¶ added in v1.9.0
PrintShortName turns a pkix.Name into a string of RDN tuples.
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)) 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)) 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 CertificateRequestInfo ¶ added in v1.9.0
type CertificateRequestInfo struct { AcceptableCAs []simplePKIXName `json:"acceptable_issuers,omitempty"` SignatureSchemes []string `json:"signature_schemes,omitempty"` }
CertificateRequestInfo has the basic information about requested client certificates
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