package
0.0.0-20230331131523-deb0478a2e52
Repository: https://github.com/hellobchain/third_party.git
Documentation: pkg.go.dev

# Packages

Package derhelpers implements common functionality on DER encoded data.

# Functions

CreateTLSConfig creates a tls.Config object from certs and roots.
DeserializeSCTList deserializes a list of SCTs.
EncodeCertificatePEM encodes a single x509 certficates to PEM.
EncodeCertificatesPEM encodes a number of x509 certficates to PEM.
ExpiryTime returns the time when the certificate chain is expired.
GetKeyDERFromPEM parses a PEM-encoded private key and returns DER-format key bytes.
HashAlgoString returns the hash algorithm name contains in the signature method.
InclusiveDate returns the time.Time representation of a date - 1 nanosecond.
KeyLength returns the bit size of ECDSA or RSA PublicKey.
LoadClientCertificate load key/certificate from pem files.
LoadPEMCertPool loads a pool of PEM certificates from file.
MonthsValid returns the number of months for which a certificate is valid.
ParseCertificatePEM parses and returns a PEM-encoded certificate, can handle PEM encoded PKCS #7 structures.
ParseCertificatesPEM parses a sequence of PEM-encoded certificate and returns them, can handle PEM encoded PKCS #7 structures.
ParseCSR parses a PEM- or DER-encoded PKCS #10 certificate signing request.
ParseCSRPEM parses a PEM-encoded certificiate signing request.
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.
ParsePrivateKeyPEM parses and returns a PEM-encoded private key.
ParsePrivateKeyPEMWithPassword parses and returns a PEM-encoded private key.
ParseSelfSignedCertificatePEM parses a PEM-encoded certificate and check if it is self-signed.
PEMToCertPool concerts PEM certificates to a CertPool.
ReadBytes reads a []byte either from a file or an environment variable.
SCTListFromOCSPResponse extracts the SCTList from an ocsp.Response, returning an empty list if the SCT extension was not found or could not be unmarshalled.
SerializeSCTList serializes a list of SCTs.
SignatureString returns the TLS signature string corresponding to an X509 signature algorithm.
SignerAlgo returns an X.509 signature algorithm from a crypto.Signer.
ValidExpiry determines if a certificate is valid for an acceptable length of time per the CA/Browser Forum baseline requirements.

# Constants

OneDay is a time.Duration representing a day's worth of seconds.
OneYear is a time.Duration representing a year's worth of seconds.

# Variables

Apr2015 is the April 2015 CAB Forum deadline for when CAs must stop issuing certificates valid for more than 39 months.
Jul2012 is the July 2012 CAB Forum deadline for when CAs must stop issuing certificates valid for more than 5 years.