Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ValidityFormat = "Jan _2 15:04:05 2006 MST"
format for NotBefore and NotAfter fields to make output similar to openssl
Functions ¶
This section is empty.
Types ¶
type Certificate ¶
type Certificate struct { Issuer DN NotBefore time.Time NotAfter time.Time Subject DN DNSNames []string IPAddresses []net.IP }
func (Certificate) ContainsDNSName ¶
func (c Certificate) ContainsDNSName(name string) bool
func (Certificate) ContainsIPAddress ¶
func (c Certificate) ContainsIPAddress(ip net.IP) bool
func (Certificate) IsExpired ¶
func (c Certificate) IsExpired() bool
func (Certificate) String ¶
func (c Certificate) String() string
type Certificates ¶
type Certificates []Certificate
func FromBytes ¶
func FromBytes(data []byte) (Certificates, error)
converts raw certificate bytes to certificate, if the supplied data is cert bundle (or chain) all the certificates will be returned
func (Certificates) GetBySubjectCommonNamePattern ¶
func (cs Certificates) GetBySubjectCommonNamePattern(subjectCNMatch string) (cert Certificate, ok bool)
returns certificate that matches subject CN match regex (Subject.CommonName), if the certificate cannot be found, second returned value will be false
Click to show internal directories.
Click to hide internal directories.