helpers

package
v0.0.0-...-f9ba299 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2014 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package helpers implements utility functionality common to many CF-SSL packages.

Index

Constants

View Source
const OneYear = 8760 * time.Hour

Variables

This section is empty.

Functions

func ExpiryTime

func ExpiryTime(chain []*x509.Certificate) *time.Time

ExpiryTime returns the time when the certificate chain is expired.

func KeyLength

func KeyLength(key interface{}) int

KeyLength returns the bit size of ECDSA or RSA PublicKey

func ParseCertificatePEM

func ParseCertificatePEM(certPEM []byte) (*x509.Certificate, error)

ParseCertificatePEM parses and returns a PEM-encoded certificate.

func ParseCertificatesPEM

func ParseCertificatesPEM(certsPEM []byte) ([]*x509.Certificate, error)

ParseCertificatesPEM parses a sequence of PEM-encoded certificate and returns them.

func ParseOneCertificateFromPEM

func ParseOneCertificateFromPEM(certsPEM []byte) (cert *x509.Certificate, rest []byte, err error)

ParseOneCertificateFromPEM attempts to parse one certificate from the top of the certsPEM, which may contain multiple certs.

func ParsePrivateKeyPEM

func ParsePrivateKeyPEM(keyPEM []byte) (key interface{}, err error)

ParsePrivateKeyPEM parses and returns a PEM-encoded private key. The private key may be either an unencrypted PKCS#8, PKCS#1, or elliptic private key.

func ParseSelfSignedCertificatePEM

func ParseSelfSignedCertificatePEM(certPEM []byte) (*x509.Certificate, error)

ParseSelfSignedCertificatePEM parses a PEM-encoded certificate and check if it is self-signed.

func SignatureString

func SignatureString(alg x509.SignatureAlgorithm) string

SignatureString returns the TLS signature string corresponding to an X509 signature algorithm.

Types

This section is empty.

Jump to

Keyboard shortcuts

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