Documentation ¶
Overview ¶
Package pki provides various generally useful PKI functionality.
Index ¶
- func CSRFromFile(filename string) (*x509.CertificateRequest, error)
- func CSRToPEMString(csr *x509.CertificateRequest) string
- func CertFromFile(filename string) (*x509.Certificate, error)
- func CertToPEMString(cert *x509.Certificate) string
- func FileIsEncryptedPEMBlock(filename string) bool
- func PEMBlockFromFile(filename string) (*pem.Block, error)
- func PrivateKeyFromFileWithPassword(filename, password string) (interface{}, error)
- func PublicKeyFromFile(filename string) (interface{}, error)
- func PublicKeyToPEMString(key interface{}) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CSRFromFile ¶
func CSRFromFile(filename string) (*x509.CertificateRequest, error)
CSRFromFile reads a PEM-encoded file and returns the PKCS#10 certificate signing request it contains. If the file does not contain a PEM-encoded PKCS#10 certificate signing request, an error is returned.
func CSRToPEMString ¶
func CSRToPEMString(csr *x509.CertificateRequest) string
CSRToPEMString encodes a CSR to a PEM-encoded string.
func CertFromFile ¶
func CertFromFile(filename string) (*x509.Certificate, error)
CertFromFile reads a PEM-encoded file and returns the X509 certificate it contains. If the file does not contain a PEM-encoded X509 certificate, an error is returned.
func CertToPEMString ¶
func CertToPEMString(cert *x509.Certificate) string
CertToPEMString encodes a certificate to a PEM-encoded string.
func FileIsEncryptedPEMBlock ¶
FileIsEncryptedPEMBlock checks if the specified file is an encrypted PEM block.
func PEMBlockFromFile ¶
PEMBlockFromFile reads a PEM-encoded file and returns a pem.Block.
func PrivateKeyFromFileWithPassword ¶
PrivateKeyFromFileWithPassword reads a PEM-encoded file and returns the private key it contains, decrypting it with the supplied password if necessary. If the file does not contain a PEM-encoded private key, an error is returned.
func PublicKeyFromFile ¶
PublicKeyFromFile reads a PEM-encoded file and returns the public key it private key it contains. If the file does not contain a PEM-encoded public key, an error is returned.
func PublicKeyToPEMString ¶
PublicKeyToPEMString encodes a PKIX public key to a PEM-encoded string.
Types ¶
This section is empty.