certs

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2018 License: MIT, Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteCert

func WriteCert(cert *Certificate) string

WriteCert will format a certificate object

Types

type Certificate

type Certificate struct {
	Issuer            string
	Subject           string
	Label             string
	Serial            string
	MD5Fingerprint    string
	SHA1Fingerprint   string
	SHA256Fingerprint string
	PEMBlock          *pem.Block
}

Certificate is an in-memory representation of a certificate.

func DecodePEMBlock

func DecodePEMBlock(data []byte) ([]*Certificate, error)

DecodePEMBlock takes a single PEM file as provided by a user and decodes it into our intermediate certificate representation.

The special function of this code is to handle the case that the user has accidentally provided us with a concatenated set of certificates. In this case, all certificates will be added to the trust store, with the label manipulated slightly to distinguish between them.

Jump to

Keyboard shortcuts

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