Documentation ¶
Index ¶
- func Decode(bs []byte) ([]*x509.Certificate, error)
- func DecodePKCS12(bs []byte, pass string) (*x509.Certificate, error)
- func FromFile(path string) ([]*x509.Certificate, error)
- func GetHexSHA1Fingerprint(c x509.Certificate) string
- func GetHexSHA256Fingerprint(c x509.Certificate) string
- func ParsePEM(blob []byte) ([]*x509.Certificate, error)
- func Sort(certs []*x509.Certificate)
- func StringifyPKIXName(name pkix.Name) (out string)
- func StringifyPubKeyAlgo(p x509.PublicKeyAlgorithm) string
- func ToFile(path string, certs []*x509.Certificate) error
- type Pool
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 StringifyPubKeyAlgo ¶
func StringifyPubKeyAlgo(p x509.PublicKeyAlgorithm) string
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