Documentation ¶
Index ¶
- func Split(pemData []byte) (key, cert []byte)
- type Certificate
- func (c *Certificate) ChainPEM() []byte
- func (c *Certificate) Fingerprint() string
- func (c *Certificate) FullPEM() []byte
- func (c *Certificate) LeafPEM() []byte
- func (c *Certificate) NotAfter() time.Time
- func (c *Certificate) PublicKeyAlgorithm() string
- func (c *Certificate) String() string
- func (c *Certificate) SubjectCN() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Certificate ¶
type Certificate struct { Certificate *tls.Certificate Leaf *x509.Certificate Chain []*x509.Certificate RawKey []byte RawCert []byte }
Certificate holds the parsed and the PEM-encoded raw key & cert
func Load ¶
func Load(key []byte, cert []byte) (*Certificate, error)
Load returns a certificate from a key- and certificate chain byte slice
func LoadFromDisk ¶
func LoadFromDisk(keyFile string, certFile string) (*Certificate, error)
LoadFromDisk returns a certificate loaded from a key- and certificate chain file
func (*Certificate) ChainPEM ¶
func (c *Certificate) ChainPEM() []byte
ChainPEM returns the raw certificate chain certificates as a pem encoded byte slice
func (*Certificate) Fingerprint ¶
func (c *Certificate) Fingerprint() string
Fingerprint returns the sha256 fingerprint of the leaf certificate
func (*Certificate) FullPEM ¶
func (c *Certificate) FullPEM() []byte
FullPEM returns the full certificate chain and private key as a pem encoded byte slice
func (*Certificate) LeafPEM ¶
func (c *Certificate) LeafPEM() []byte
LeafPEM returns the raw leaf cert as a pem encoded byte slice
func (*Certificate) NotAfter ¶
func (c *Certificate) NotAfter() time.Time
NotAfter returns the expire date of the leaf certificate
func (*Certificate) PublicKeyAlgorithm ¶
func (c *Certificate) PublicKeyAlgorithm() string
PublicKeyAlgorithm returns the public key algorithm of the leaf certificate
func (*Certificate) String ¶
func (c *Certificate) String() string
String returns the private key concatenated with the whole certificate chain as a PEM-encoded string
func (*Certificate) SubjectCN ¶
func (c *Certificate) SubjectCN() string
SubjectCN returns the subject CN of the leaf certificate