Documentation ¶
Index ¶
- Constants
- func GetCurrentTime() time.Time
- func GetDNType() x509util.DNType
- func GetOutput() io.Writer
- func GetVerbose() int
- func Print(a ...interface{}) (n int, err error)
- func Printf(format string, a ...interface{}) (n int, err error)
- func Println(a ...interface{}) (n int, err error)
- func SetCurrentTime(t time.Time)
- func SetDNType(t x509util.DNType)
- func SetOutput(w io.Writer)
- func SetVerbose(v int)
- type CertificateChainChecker
- func (c *CertificateChainChecker) Details() interface{}
- func (c *CertificateChainChecker) Message() string
- func (c *CertificateChainChecker) Name() string
- func (c *CertificateChainChecker) PrintDetails()
- func (c *CertificateChainChecker) PrintName()
- func (c *CertificateChainChecker) PrintStatus()
- func (c *CertificateChainChecker) Status() Status
- type CertificateChainDetails
- type CertificateChecker
- func (c *CertificateChecker) Details() interface{}
- func (c *CertificateChecker) Message() string
- func (c *CertificateChecker) Name() string
- func (c *CertificateChecker) PrintDetails()
- func (c *CertificateChecker) PrintName()
- func (c *CertificateChecker) PrintStatus()
- func (c *CertificateChecker) Status() Status
- type CertificateDetails
- type CertificateFileInfo
- type CertificateFilesChecker
- func (c *CertificateFilesChecker) Details() interface{}
- func (c *CertificateFilesChecker) Message() string
- func (c *CertificateFilesChecker) Name() string
- func (c *CertificateFilesChecker) PrintDetails()
- func (c *CertificateFilesChecker) PrintName()
- func (c *CertificateFilesChecker) PrintStatus()
- func (c *CertificateFilesChecker) Status() Status
- type CertificateFilesDetails
- type CertificateInfo
- type CertificateListChecker
- func (c *CertificateListChecker) Details() interface{}
- func (c *CertificateListChecker) Message() string
- func (c *CertificateListChecker) Name() string
- func (c *CertificateListChecker) PrintDetails()
- func (c *CertificateListChecker) PrintName()
- func (c *CertificateListChecker) PrintStatus()
- func (c *CertificateListChecker) Status() Status
- type CertificateListDetails
- type Checker
- type HostnameChecker
- type HostnameDetails
- type JSONableResult
- type KeyPairChecker
- type KeyPairDetails
- type OCSPResponderChecker
- func (c *OCSPResponderChecker) Details() interface{}
- func (c *OCSPResponderChecker) Message() string
- func (c *OCSPResponderChecker) Name() string
- func (c *OCSPResponderChecker) PrintDetails()
- func (c *OCSPResponderChecker) PrintName()
- func (c *OCSPResponderChecker) PrintStatus()
- func (c *OCSPResponderChecker) Status() Status
- type OCSPResponseData
- type OCSPResponseDetails
- type OCSPResponseInfo
- type OCSPStaplingChecker
- func (c *OCSPStaplingChecker) Details() interface{}
- func (c *OCSPStaplingChecker) Message() string
- func (c *OCSPStaplingChecker) Name() string
- func (c *OCSPStaplingChecker) PrintDetails()
- func (c *OCSPStaplingChecker) PrintName()
- func (c *OCSPStaplingChecker) PrintStatus()
- func (c *OCSPStaplingChecker) Status() Status
- type OutputFormat
- type Result
- type Status
- type Summary
- type ValidityChecker
- type ValidityDetails
Constants ¶
const ( OK = Status(iota) WARNING CRITICAL UNKNOWN INFO // for internal statuses ERROR // for internal statuses )
Status Code
const ( // Default output format DefaultFormat = OutputFormat(iota) // JSON output format JSONFormat )
Variables ¶
This section is empty.
Functions ¶
func GetCurrentTime ¶ added in v0.9.0
GetCurrentTime gets a current time.
func Print ¶
Print formats using the default formats for its operands and writes to the specified output. Spaces are added between operands when neither is a string. It returns the number of bytes written and any write error encountered.
func Printf ¶
Printf formats according to a format specifier and writes to the specified output. It returns the number of bytes written and any write error encountered.
func Println ¶
Println formats using the default formats for its operands and writes to the specified output. Spaces are always added between operands and a newline is appended. It returns the number of bytes written and any write error encountered.
func SetCurrentTime ¶ added in v0.9.0
SetCurrentTime sets a current time.
Types ¶
type CertificateChainChecker ¶ added in v0.9.0
type CertificateChainChecker struct {
// contains filtered or unexported fields
}
CertificateChainChecker represents wheather certificate chains are valid.
func NewCertificateChainChecker ¶ added in v0.9.0
func NewCertificateChainChecker(certs []*x509.Certificate, rootCertPool *x509.CertPool) *CertificateChainChecker
func (*CertificateChainChecker) Details ¶ added in v0.9.0
func (c *CertificateChainChecker) Details() interface{}
func (*CertificateChainChecker) Message ¶ added in v0.9.0
func (c *CertificateChainChecker) Message() string
func (*CertificateChainChecker) Name ¶ added in v0.9.0
func (c *CertificateChainChecker) Name() string
func (*CertificateChainChecker) PrintDetails ¶ added in v0.9.0
func (c *CertificateChainChecker) PrintDetails()
func (*CertificateChainChecker) PrintName ¶ added in v0.9.0
func (c *CertificateChainChecker) PrintName()
func (*CertificateChainChecker) PrintStatus ¶ added in v0.9.0
func (c *CertificateChainChecker) PrintStatus()
func (*CertificateChainChecker) Status ¶ added in v0.9.0
func (c *CertificateChainChecker) Status() Status
type CertificateChainDetails ¶ added in v0.9.0
type CertificateChainDetails [][]CertificateInfo
func NewCertificateChainDetails ¶ added in v0.9.0
func NewCertificateChainDetails(c [][]CertificateInfo) CertificateChainDetails
type CertificateChecker ¶ added in v0.9.0
type CertificateChecker struct {
// contains filtered or unexported fields
}
CertificateChecker represents a certificate information.
func NewCertificateChecker ¶ added in v0.9.0
func NewCertificateChecker(cert *x509.Certificate) *CertificateChecker
func (*CertificateChecker) Details ¶ added in v0.9.0
func (c *CertificateChecker) Details() interface{}
func (*CertificateChecker) Message ¶ added in v0.9.0
func (c *CertificateChecker) Message() string
func (*CertificateChecker) Name ¶ added in v0.9.0
func (c *CertificateChecker) Name() string
func (*CertificateChecker) PrintDetails ¶ added in v0.9.0
func (c *CertificateChecker) PrintDetails()
func (*CertificateChecker) PrintName ¶ added in v0.9.0
func (c *CertificateChecker) PrintName()
func (*CertificateChecker) PrintStatus ¶ added in v0.9.0
func (c *CertificateChecker) PrintStatus()
func (*CertificateChecker) Status ¶ added in v0.9.0
func (c *CertificateChecker) Status() Status
type CertificateDetails ¶ added in v0.9.0
type CertificateDetails struct { Issuer string `json:"issuer"` Subject string `json:"subject"` SubjectAltName []subjectAltName `json:"subjectAltName,omitempty"` Validity validity `json:"validity"` SubjectPublicKeyInfo *publicKeyInfo `json:"subjectPublicKeyInfo,omitempty"` }
func NewCertificateDetails ¶ added in v0.9.0
func NewCertificateDetails(cert *x509.Certificate) *CertificateDetails
type CertificateFileInfo ¶
type CertificateFileInfo struct { Name string `json:"name"` File string `json:"file"` Status Status `json:"-"` StatusString string `json:"status"` Error string `json:"error,omitempty"` CertificateInfoList []CertificateInfo `json:"certificate"` // contains filtered or unexported fields }
CertificateFileInfo describes an information in a certificate file.
func NewCertificateFileInfo ¶ added in v0.9.0
func NewCertificateFileInfo(name string, certFile string, parent *x509.Certificate, isRoot bool) (CertificateFileInfo, *x509.Certificate)
type CertificateFilesChecker ¶ added in v0.9.0
type CertificateFilesChecker struct {
// contains filtered or unexported fields
}
CertificateFilesChecker represents certificate files are.
func NewCertificateFilesChecker ¶ added in v0.9.0
func NewCertificateFilesChecker(certFile string, chainFile string, caFile string, rootFile string) *CertificateFilesChecker
func (*CertificateFilesChecker) Details ¶ added in v0.9.0
func (c *CertificateFilesChecker) Details() interface{}
func (*CertificateFilesChecker) Message ¶ added in v0.9.0
func (c *CertificateFilesChecker) Message() string
func (*CertificateFilesChecker) Name ¶ added in v0.9.0
func (c *CertificateFilesChecker) Name() string
func (*CertificateFilesChecker) PrintDetails ¶ added in v0.9.0
func (c *CertificateFilesChecker) PrintDetails()
func (*CertificateFilesChecker) PrintName ¶ added in v0.9.0
func (c *CertificateFilesChecker) PrintName()
func (*CertificateFilesChecker) PrintStatus ¶ added in v0.9.0
func (c *CertificateFilesChecker) PrintStatus()
func (*CertificateFilesChecker) Status ¶ added in v0.9.0
func (c *CertificateFilesChecker) Status() Status
type CertificateFilesDetails ¶ added in v0.9.0
type CertificateFilesDetails []CertificateFileInfo
func NewCertificateFilesDetails ¶ added in v0.9.0
func NewCertificateFilesDetails(list []CertificateFileInfo) CertificateFilesDetails
type CertificateInfo ¶
type CertificateInfo struct { CommonName string `json:"commonName"` Status Status `json:"-"` StatusString string `json:"status"` Subject string `json:"subject"` Issuer string `json:"issuer"` Expiration string `json:"expiration"` Message string `json:"message,omitempty"` Error string `json:"error,omitempty"` }
func NewCertificateInfo ¶ added in v0.9.0
func NewCertificateInfo(cert *x509.Certificate, parent *x509.Certificate, forceParentToCheck bool) CertificateInfo
type CertificateListChecker ¶ added in v0.9.0
type CertificateListChecker struct {
// contains filtered or unexported fields
}
CertificateListChecker represents wheather peer certificates are valid.
func NewCertificateListChecker ¶ added in v0.9.0
func NewCertificateListChecker(certs []*x509.Certificate) *CertificateListChecker
func (*CertificateListChecker) Details ¶ added in v0.9.0
func (c *CertificateListChecker) Details() interface{}
func (*CertificateListChecker) Message ¶ added in v0.9.0
func (c *CertificateListChecker) Message() string
func (*CertificateListChecker) Name ¶ added in v0.9.0
func (c *CertificateListChecker) Name() string
func (*CertificateListChecker) PrintDetails ¶ added in v0.9.0
func (c *CertificateListChecker) PrintDetails()
func (*CertificateListChecker) PrintName ¶ added in v0.9.0
func (c *CertificateListChecker) PrintName()
func (*CertificateListChecker) PrintStatus ¶ added in v0.9.0
func (c *CertificateListChecker) PrintStatus()
func (*CertificateListChecker) Status ¶ added in v0.9.0
func (c *CertificateListChecker) Status() Status
type CertificateListDetails ¶ added in v0.9.0
type CertificateListDetails []CertificateInfo
func NewCertificateListDetails ¶ added in v0.9.0
func NewCertificateListDetails(list []CertificateInfo) CertificateListDetails
type HostnameChecker ¶ added in v0.9.0
type HostnameChecker struct {
// contains filtered or unexported fields
}
HostnameChecker represents whether a hostname is valid for a certificate.
func NewHostnameChecker ¶ added in v0.9.0
func NewHostnameChecker(hostname string, cert *x509.Certificate) *HostnameChecker
func (*HostnameChecker) Details ¶ added in v0.9.0
func (c *HostnameChecker) Details() interface{}
func (*HostnameChecker) Message ¶ added in v0.9.0
func (c *HostnameChecker) Message() string
func (*HostnameChecker) Name ¶ added in v0.9.0
func (c *HostnameChecker) Name() string
func (*HostnameChecker) PrintDetails ¶ added in v0.9.0
func (c *HostnameChecker) PrintDetails()
func (*HostnameChecker) PrintName ¶ added in v0.9.0
func (c *HostnameChecker) PrintName()
func (*HostnameChecker) PrintStatus ¶ added in v0.9.0
func (c *HostnameChecker) PrintStatus()
func (*HostnameChecker) Status ¶ added in v0.9.0
func (c *HostnameChecker) Status() Status
type HostnameDetails ¶ added in v0.9.0
type HostnameDetails struct { CommonName string `json:"commonName"` SubjectAltName []subjectAltName `json:"subjectAltName,omitempty"` }
func NewHostnameDetails ¶ added in v0.9.0
func NewHostnameDetails(cert *x509.Certificate) *HostnameDetails
type JSONableResult ¶ added in v0.9.0
type JSONableResult struct { Metadata jsonableMetadata `json:"metadata"` Result jsonableResult `json:"result,omitempty"` }
type KeyPairChecker ¶ added in v0.9.0
type KeyPairChecker struct {
// contains filtered or unexported fields
}
KeyPairChecker represents wheather a private key is paired with a certificate.
func NewKeyPairChecker ¶ added in v0.9.0
func NewKeyPairChecker(pubKeyInfoInPrivKey, pubKeyInfo x509util.PublicKeyInfo) *KeyPairChecker
func (*KeyPairChecker) Details ¶ added in v0.9.0
func (c *KeyPairChecker) Details() interface{}
func (*KeyPairChecker) Message ¶ added in v0.9.0
func (c *KeyPairChecker) Message() string
func (*KeyPairChecker) Name ¶ added in v0.9.0
func (c *KeyPairChecker) Name() string
func (*KeyPairChecker) PrintDetails ¶ added in v0.9.0
func (c *KeyPairChecker) PrintDetails()
func (*KeyPairChecker) PrintName ¶ added in v0.9.0
func (c *KeyPairChecker) PrintName()
func (*KeyPairChecker) PrintStatus ¶ added in v0.9.0
func (c *KeyPairChecker) PrintStatus()
func (*KeyPairChecker) Status ¶ added in v0.9.0
func (c *KeyPairChecker) Status() Status
type KeyPairDetails ¶ added in v0.9.0
type KeyPairDetails struct { PrivateKey *publicKeyInfo `json:"privateKey"` Certificate *publicKeyInfo `json:"certificate"` }
func NewKeyPairDetails ¶ added in v0.9.0
func NewKeyPairDetails(pubKeyInfoInPrivKey, pubKeyInfo x509util.PublicKeyInfo) *KeyPairDetails
type OCSPResponderChecker ¶ added in v0.9.0
type OCSPResponderChecker struct {
// contains filtered or unexported fields
}
OCSPResponderChecker represents wheather the response from OCSP Responder is valie.
func NewOCSPResponderChecker ¶ added in v0.9.0
func NewOCSPResponderChecker(targetCert *x509.Certificate, issuer *x509.Certificate, intermediateCerts []*x509.Certificate, rootCertPool *x509.CertPool) *OCSPResponderChecker
func (*OCSPResponderChecker) Details ¶ added in v0.9.0
func (c *OCSPResponderChecker) Details() interface{}
func (*OCSPResponderChecker) Message ¶ added in v0.9.0
func (c *OCSPResponderChecker) Message() string
func (*OCSPResponderChecker) Name ¶ added in v0.9.0
func (c *OCSPResponderChecker) Name() string
func (*OCSPResponderChecker) PrintDetails ¶ added in v0.9.0
func (c *OCSPResponderChecker) PrintDetails()
func (*OCSPResponderChecker) PrintName ¶ added in v0.9.0
func (c *OCSPResponderChecker) PrintName()
func (*OCSPResponderChecker) PrintStatus ¶ added in v0.9.0
func (c *OCSPResponderChecker) PrintStatus()
func (*OCSPResponderChecker) Status ¶ added in v0.9.0
func (c *OCSPResponderChecker) Status() Status
type OCSPResponseData ¶ added in v0.9.0
type OCSPResponseData struct { OCSPResponseStatus string `json:"oCSPResponseStatus,omitempty"` CertStatus string `json:"certStatus,omitempty"` ProducedAt string `json:"producedAt,omitempty"` RevocationTime string `json:"revocationTime,omitempty"` RevocationReason string `json:"revocationReason,omitempty"` ThisUpdate string `json:"thisUpdate,omitempty"` NextUpdate string `json:"nextUpdate,omitempty"` }
type OCSPResponseDetails ¶ added in v0.9.0
type OCSPResponseDetails struct { OCSPResponder string `json:"oCSPResponder,omitempty"` OCSPResponseData *OCSPResponseData `json:"oCSPResponseData,omitempty"` Certificate *CertificateDetails `json:"certificate,omitempty"` }
OCSPResponseDetails is an OCSP response.
func NewOCSPResponseData ¶ added in v0.9.0
func NewOCSPResponseData(responseInfo *OCSPResponseInfo) *OCSPResponseDetails
type OCSPResponseInfo ¶
type OCSPResponseInfo struct { Status Status Message string Server string Response *ocsp.Response ResponseStatus ocsp.ResponseStatus }
OCSPResponseInfo describes an information of OCSP response.
func NewOCSPResponseInfo ¶ added in v0.9.0
func NewOCSPResponseInfo(ocspResponse []byte, targetCert, issuer *x509.Certificate, intermediateCerts []*x509.Certificate, rootCertPool *x509.CertPool) *OCSPResponseInfo
type OCSPStaplingChecker ¶ added in v0.9.0
type OCSPStaplingChecker struct {
// contains filtered or unexported fields
}
OCSPStaplingChecker represents wheather the response from OCSP Stapling is valid.
func NewOCSPStaplingChecker ¶ added in v0.9.0
func NewOCSPStaplingChecker(ocspResponse []byte, issuer *x509.Certificate, intermediateCerts []*x509.Certificate, rootCertPool *x509.CertPool, allowNonReponse bool) *OCSPStaplingChecker
NewOCSPStaplingChecker returns a new OCSPStaplingChecker.
func (*OCSPStaplingChecker) Details ¶ added in v0.9.0
func (c *OCSPStaplingChecker) Details() interface{}
func (*OCSPStaplingChecker) Message ¶ added in v0.9.0
func (c *OCSPStaplingChecker) Message() string
func (*OCSPStaplingChecker) Name ¶ added in v0.9.0
func (c *OCSPStaplingChecker) Name() string
func (*OCSPStaplingChecker) PrintDetails ¶ added in v0.9.0
func (c *OCSPStaplingChecker) PrintDetails()
func (*OCSPStaplingChecker) PrintName ¶ added in v0.9.0
func (c *OCSPStaplingChecker) PrintName()
func (*OCSPStaplingChecker) PrintStatus ¶ added in v0.9.0
func (c *OCSPStaplingChecker) PrintStatus()
func (*OCSPStaplingChecker) Status ¶ added in v0.9.0
func (c *OCSPStaplingChecker) Status() Status
type Status ¶
type Status int
Status is a status code for monitoring.
func (Status) ColorString ¶
ColorString returns a status string with color.
type Summary ¶ added in v0.9.0
type Summary struct {
// contains filtered or unexported fields
}
func NewErrorSummary ¶ added in v0.9.0
func NewSummary ¶ added in v0.9.0
func (*Summary) PrintDetails ¶ added in v0.9.0
func (s *Summary) PrintDetails()
func (*Summary) PrintStatus ¶ added in v0.9.0
func (s *Summary) PrintStatus()
type ValidityChecker ¶ added in v0.9.0
type ValidityChecker struct {
// contains filtered or unexported fields
}
ValidityChecker represents wheather the validity of a certificate is valid.
func NewValidityChecker ¶ added in v0.9.0
func NewValidityChecker(cert *x509.Certificate, warning int, critical int) *ValidityChecker
NewValidityChecker returns a new ValidityChecker.
func (*ValidityChecker) Details ¶ added in v0.9.0
func (c *ValidityChecker) Details() interface{}
func (*ValidityChecker) Message ¶ added in v0.9.0
func (c *ValidityChecker) Message() string
func (*ValidityChecker) Name ¶ added in v0.9.0
func (c *ValidityChecker) Name() string
func (*ValidityChecker) PrintDetails ¶ added in v0.9.0
func (c *ValidityChecker) PrintDetails()
func (*ValidityChecker) PrintName ¶ added in v0.9.0
func (c *ValidityChecker) PrintName()
func (*ValidityChecker) PrintStatus ¶ added in v0.9.0
func (c *ValidityChecker) PrintStatus()
func (*ValidityChecker) Status ¶ added in v0.9.0
func (c *ValidityChecker) Status() Status
type ValidityDetails ¶ added in v0.9.0
type ValidityDetails struct { NotBefore string `json:"notBefore"` NotAfter string `json:"notAfter"` }
ValidityDetails is the validity of a certificate.
func NewValidityDetails ¶ added in v0.9.0
func NewValidityDetails(cert *x509.Certificate) *ValidityDetails
NewValidityDetails returns a new ValidityDetails.