certutils

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TYPE_URL  = "url"
	TYPE_FILE = "file"
)

Variables

View Source
var (
	ErrCertNotFound                 = errors.New("Certificate for a given url couldn't be found or matched")
	ErrMoreThanOneNoneCaCertInChain = errors.New("Certificate chain has more than one non CA cert. That is a problem")
)

Functions

This section is empty.

Types

type CertInfo

type CertInfo struct {
	Type        string    `json:"type"`
	Subject     string    `json:"subject"`
	NotAfter    time.Time `json:"not_after"`
	Certificate *x509.Certificate
}

func GetCertInfoForFile

func GetCertInfoForFile(rawCertBlockFromFile []byte) (*CertInfo, error)

func GetCertInfoForUrl

func GetCertInfoForUrl(urlInfo *url.URL) (*CertInfo, error)

func (*CertInfo) DisplayInfo

func (ci *CertInfo) DisplayInfo()

func (*CertInfo) ExpiresIn

func (ci *CertInfo) ExpiresIn() time.Duration

func (*CertInfo) ExpiresInString

func (ci *CertInfo) ExpiresInString() string

func (*CertInfo) Status

func (ci *CertInfo) Status() string

Jump to

Keyboard shortcuts

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