Documentation ¶
Overview ¶
Package helpers implements utility functionality common to many CFSSL packages.
Index ¶
- Constants
- func ExpiryTime(chain []*x509.Certificate) *time.Time
- func GetKeyDERFromPEM(in []byte) ([]byte, error)
- func HashAlgoString(alg x509.SignatureAlgorithm) string
- func KeyLength(key interface{}) int
- func ParseCertificatePEM(certPEM []byte) (*x509.Certificate, error)
- func ParseCertificatesDER(certsDER []byte, password string) ([]*x509.Certificate, crypto.Signer, error)
- func ParseCertificatesPEM(certsPEM []byte) ([]*x509.Certificate, error)
- func ParseOneCertificateFromPEM(certsPEM []byte) ([]*x509.Certificate, []byte, error)
- func ParsePrivateKeyPEM(keyPEM []byte) (key crypto.Signer, err error)
- func ParseSelfSignedCertificatePEM(certPEM []byte) (*x509.Certificate, error)
- func SignatureString(alg x509.SignatureAlgorithm) string
Constants ¶
const OneDay = 24 * time.Hour
OneDay is a time.Duration representing a day's worth of seconds.
const OneYear = 8760 * time.Hour
OneYear is a time.Duration representing a year's worth of seconds.
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 GetKeyDERFromPEM ¶
GetKeyDERFromPEM parses a PEM-encoded private key and returns DER-format key bytes.
func HashAlgoString ¶
func HashAlgoString(alg x509.SignatureAlgorithm) string
HashAlgoString returns the hash algorithm name contains in the signature method.
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, can handle PEM encoded PKCS #7 structures.
func ParseCertificatesDER ¶
func ParseCertificatesDER(certsDER []byte, password string) ([]*x509.Certificate, crypto.Signer, error)
ParseCertificatesDER parses a DER encoding of a certificate object and possibly private key, either PKCS #7, PKCS #12, or raw x509.
func ParseCertificatesPEM ¶
func ParseCertificatesPEM(certsPEM []byte) ([]*x509.Certificate, error)
ParseCertificatesPEM parses a sequence of PEM-encoded certificate and returns them, can handle PEM encoded PKCS #7 structures.
func ParseOneCertificateFromPEM ¶
func ParseOneCertificateFromPEM(certsPEM []byte) ([]*x509.Certificate, []byte, error)
ParseOneCertificateFromPEM attempts to parse one PEM encoded certificate object, either a raw x509 certificate or a PKCS #7 structure possibly containing multiple certificates, from the top of certsPEM, which itself may contain multiple PEM encoded certificate objects.
func ParsePrivateKeyPEM ¶
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.
Directories ¶
Path | Synopsis |
---|---|
Package derhelpers implements common functionality on DER encoded data
|
Package derhelpers implements common functionality on DER encoded data |
Package pkcs11uri provides helpers for parsing PKCS #11 URIs.
|
Package pkcs11uri provides helpers for parsing PKCS #11 URIs. |