Documentation ¶
Overview ¶
Package pki provides helper methods for manipulating X.509 objects.
Index ¶
- func CertificateToPem(cert *x509.Certificate) []byte
- func CreateSimpleCertRequest(subject Subject, key crypto.Signer) (*x509.CertificateRequest, error)
- func IsRootCACert(cert *x509.Certificate) bool
- func ParsePemCertificate(pemCert []byte) (*x509.Certificate, error)
- func PrivateKeyToPem(key crypto.Signer, password []byte) ([]byte, error)
- type Subject
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CertificateToPem ¶
func CertificateToPem(cert *x509.Certificate) []byte
CertificateToPem converts a certificate into PEM format
func CreateSimpleCertRequest ¶
CreateSimpleCertRequest makes a certificate request for the supplied subject.
func IsRootCACert ¶
func IsRootCACert(cert *x509.Certificate) bool
IsRootCACert tests whether a certificate is a root CA certificate by checking the certificate is self-signed and validating the Basic Constraints, if present.
WARNING: Do not use this function to determine whether to trust the certificate.
func ParsePemCertificate ¶
func ParsePemCertificate(pemCert []byte) (*x509.Certificate, error)
ParsePemCertificate reads a certificate from PEM format. Only the first PEM object in the input data is read.
Types ¶
Click to show internal directories.
Click to hide internal directories.