tlscerts

package
v0.12.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

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

type DN

type DN struct {
	Organization []string
	CommonName   string
}

func (DN) String

func (dn DN) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL