certutil

package
v0.0.0-...-4d45f13 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: Apache-2.0 Imports: 18 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(bs []byte) ([]*x509.Certificate, error)

Decode attempts to read `bs` with a few different parsers to return an array of x509 Certificates

func DecodePKCS12

func DecodePKCS12(bs []byte, pass string) (*x509.Certificate, error)

func FromFile

func FromFile(path string) ([]*x509.Certificate, error)

FromFile reads a series of PEM encoded blocks from the given file

func GetHexSHA1Fingerprint

func GetHexSHA1Fingerprint(c x509.Certificate) string

func GetHexSHA256Fingerprint

func GetHexSHA256Fingerprint(c x509.Certificate) string

func ParsePEM

func ParsePEM(blob []byte) ([]*x509.Certificate, error)

ParsePEM will extract the slice of certificates encoded in PEM format

func Sort

func Sort(certs []*x509.Certificate)

func StringifyPKIXName

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

func StringifyPubKeyAlgo

func StringifyPubKeyAlgo(p x509.PublicKeyAlgorithm) string

func ToFile

func ToFile(path string, certs []*x509.Certificate) error

ToFile overwrites file at `path` with the certificates encoded in PEM format.

Types

type Pool

type Pool struct {
	// contains filtered or unexported fields
}

Pool represents an append-only collection of x509 Certificates. There are no nessary connections between the certificates, except that each will only appear once in the pool.

func (*Pool) Add

func (p *Pool) Add(c *x509.Certificate)

Add will include the given certificate into the pool if it does not exist already

func (*Pool) AddCertificates

func (p *Pool) AddCertificates(certs []*x509.Certificate)

AddCertificates includes multiple certificates into the pool. No duplicate certificates will be added.

func (*Pool) GetCertificates

func (p *Pool) GetCertificates() []*x509.Certificate

GetCertificates returns all x509.Certificate objects included in the pool

Jump to

Keyboard shortcuts

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