certigo: github.com/square/certigo/lib Index | Files

package lib

import "github.com/square/certigo/lib"

Index

Package Files

certs.go display.go encoder.go ocsp.go oids.go tls.go verify.go

func EncodeCRIToObject Uses

func EncodeCRIToObject(cri *tls.CertificateRequestInfo) (interface{}, error)

EncodeCRIToObject returns a JSON-marshallable representation of a CertificateRequestInfo object.

func EncodeTLSInfoToText Uses

func EncodeTLSInfoToText(tcs *tls.ConnectionState, cri *tls.CertificateRequestInfo) string

EncodeTLSInfoToText returns a human readable string, suitable for certigo console output.

func EncodeTLSToObject Uses

func EncodeTLSToObject(t *tls.ConnectionState) interface{}

EncodeTLSToObject returns a JSON-marshallable description of a TLS connection

func EncodeX509ToJSON Uses

func EncodeX509ToJSON(cert *x509.Certificate) []byte

EncodeX509ToJSON encodes an X.509 certificate into a JSON string.

func EncodeX509ToObject Uses

func EncodeX509ToObject(cert *x509.Certificate) interface{}

EncodeX509ToObject encodes an X.509 certificate into a JSON-serializable object.

func EncodeX509ToPEM Uses

func EncodeX509ToPEM(cert *x509.Certificate, headers map[string]string) *pem.Block

EncodeX509ToPEM converts an X.509 certificate into a PEM block for output.

func EncodeX509ToText Uses

func EncodeX509ToText(cert *x509.Certificate, terminalWidth int, verbose bool) []byte

EncodeX509ToText encodes an X.509 certificate into human-readable text.

func IsSelfSigned Uses

func IsSelfSigned(cert *x509.Certificate) bool

IsSelfSigned returns true iff the given certificate has a valid self-signature.

func PrintCommonName Uses

func PrintCommonName(name pkix.Name) (out string)

PrintCommonName prints the CN from a pkix.Name, or falls back to PrintShortName if CN is missing.

func PrintShortName Uses

func PrintShortName(name pkix.Name) (out string)

PrintShortName turns a pkix.Name into a string of RDN tuples.

func PrintVerifyResult Uses

func PrintVerifyResult(out io.Writer, result SimpleVerification)

func ReadAsPEM Uses

func ReadAsPEM(readers []io.Reader, format string, password func(string) string, callback func(*pem.Block, string) error) 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 Uses

func ReadAsPEMFromFiles(files []*os.File, format string, password func(string) string, callback func(*pem.Block, string) error) 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 Uses

func ReadAsX509(readers []io.Reader, format string, password func(string) string, callback func(*x509.Certificate, string, error) 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 Uses

func ReadAsX509FromFiles(files []*os.File, format string, password func(string) string, callback func(*x509.Certificate, string, error) 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.

type CertificateRequestInfo Uses

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 Uses

type OidDescription struct {
    Name     string
    Short    string
    Slug     string
    Multiple bool
}

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 SimpleResult Uses

type SimpleResult struct {
    Certificates           []*x509.Certificate `json:"certificates"`
    Formats                []string
    VerifyResult           *SimpleVerification `json:"verify_result,omitempty"`
    TLSConnectionState     *tls.ConnectionState
    CertificateRequestInfo *tls.CertificateRequestInfo
}

func (SimpleResult) MarshalJSON Uses

func (s SimpleResult) MarshalJSON() ([]byte, error)

type SimpleVerification Uses

type SimpleVerification struct {
    Error          string               `json:"error,omitempty"`
    OCSPStatus     *ocsp.Response       `json:"ocsp_response,omitempty"`
    OCSPWasStapled bool                 `json:"ocsp_was_stapled,omitempty"`
    OCSPError      string               `json:"ocsp_error,omitempty"`
    Chains         [][]simpleVerifyCert `json:"chains"`
}

func VerifyChain Uses

func VerifyChain(certs []*x509.Certificate, ocspStaple []byte, dnsName, caPath string) SimpleVerification

type TLSDescription Uses

type TLSDescription struct {
    Version string `json:"version"`
    Cipher  string `json:"cipher"`
}

TLSDescription has the basic information about a TLS connection

Package lib imports 34 packages (graph) and is imported by 13 packages. Updated 2020-07-09. Refresh now. Tools for package owners.