Documentation ¶
Index ¶
- Variables
- func MarshalCertificate(crt *x509.Certificate) ([]byte, error)
- func MarshalCertificateRequest(csr *x509.CertificateRequest) ([]byte, error)
- func MarshalPrivateKey(key crypto.PrivateKey) ([]byte, error)
- func MarshalPublicKey(key crypto.PublicKey) ([]byte, error)
- func MarshalPublicKeySSH(key crypto.PublicKey) ([]byte, error)
- func NewCertificateRequest(tpl *x509.CertificateRequest, priv interface{}) (*x509.CertificateRequest, error)
- func NewPrivateKey() (crypto.PrivateKey, error)
- func ReadCertificate(filename string) (*x509.Certificate, error)
- func ReadPrivateKey(filename string) (crypto.PrivateKey, error)
- func UnmarshalCertificate(raw []byte) (*x509.Certificate, error)
- func UnmarshalCertificateRequest(raw []byte) (*x509.CertificateRequest, error)
- func UnmarshalPrivateKey(raw []byte) (crypto.PrivateKey, error)
- func WriteCertificate(filename string, crt *x509.Certificate) error
- func WriteCertificateRequest(filename string, csr *x509.CertificateRequest) error
- func WritePrivateKey(filename string, key crypto.PrivateKey) error
- func WritePublicKey(filename string, key crypto.PublicKey) error
- func WritePublicKeySSH(filename string, key crypto.PublicKey) error
Constants ¶
This section is empty.
Variables ¶
var ( // EllipticCurve is the default curve used for key generation EllipticCurve = elliptic.P256() )
Functions ¶
func MarshalCertificate ¶
func MarshalCertificate(crt *x509.Certificate) ([]byte, error)
MarshalCertificate returns PEM encoding of certificate
func MarshalCertificateRequest ¶
func MarshalCertificateRequest(csr *x509.CertificateRequest) ([]byte, error)
MarshalCertificateRequest returns PEM encoding of certificate request
func MarshalPrivateKey ¶
func MarshalPrivateKey(key crypto.PrivateKey) ([]byte, error)
MarshalPrivateKey returns PEM encoding of key
func MarshalPublicKey ¶
MarshalPublicKey returns PEM encoding of key
func MarshalPublicKeySSH ¶
MarshalPublicKeySSH returns OpenSSH encoding of key
func NewCertificateRequest ¶
func NewCertificateRequest(tpl *x509.CertificateRequest, priv interface{}) (*x509.CertificateRequest, error)
NewCertificateRequest creates new signed certificate request using the given key
func NewPrivateKey ¶
func NewPrivateKey() (crypto.PrivateKey, error)
NewPrivateKey generates new private key using `EllipticCurve`
func ReadCertificate ¶
func ReadCertificate(filename string) (*x509.Certificate, error)
ReadCertificate loads certificate from file
func ReadPrivateKey ¶
func ReadPrivateKey(filename string) (crypto.PrivateKey, error)
ReadPrivateKey loads private key from file
func UnmarshalCertificate ¶
func UnmarshalCertificate(raw []byte) (*x509.Certificate, error)
UnmarshalCertificate parses certificate from PEM-encoded bytes
func UnmarshalCertificateRequest ¶
func UnmarshalCertificateRequest(raw []byte) (*x509.CertificateRequest, error)
UnmarshalCertificateRequest parses certificate request from PEM-encoded bytes
func UnmarshalPrivateKey ¶
func UnmarshalPrivateKey(raw []byte) (crypto.PrivateKey, error)
UnmarshalPrivateKey parses private key from PEM-encoded bytes
func WriteCertificate ¶
func WriteCertificate(filename string, crt *x509.Certificate) error
WriteCertificate saves certificate to file
func WriteCertificateRequest ¶
func WriteCertificateRequest(filename string, csr *x509.CertificateRequest) error
WriteCertificateRequest saves certificate request to file
func WritePrivateKey ¶
func WritePrivateKey(filename string, key crypto.PrivateKey) error
WritePrivateKey saves private key to file
func WritePublicKey ¶
WritePublicKey saves public key to file
Types ¶
This section is empty.