Documentation ¶
Index ¶
- Constants
- func DecodeCertPEM(encoded []byte) (*x509.Certificate, error)
- func DecodePrivateKeyPEM(encoded []byte) (crypto.Signer, error)
- func EncodeCertPEM(cert *x509.Certificate) []byte
- func EncodePrivateKeyPEM(key *rsa.PrivateKey) []byte
- func EncodePublicKeyPEM(key *rsa.PublicKey) ([]byte, error)
- func NewCA(config *certutil.Config) (*x509.Certificate, *rsa.PrivateKey, error)
- func NewCertAndKey(caCert *x509.Certificate, caKey crypto.Signer, config *certutil.Config) (*x509.Certificate, *rsa.PrivateKey, error)
- func NewPrivateKey() (*rsa.PrivateKey, error)
- func NewPubAndKey() (*rsa.PublicKey, *rsa.PrivateKey, error)
Constants ¶
View Source
const (
// DefaultRSAKeySize is the default key size used when created RSA keys.
DefaultRSAKeySize = 2048
)
Variables ¶
This section is empty.
Functions ¶
func DecodeCertPEM ¶
func DecodeCertPEM(encoded []byte) (*x509.Certificate, error)
DecodeCertPEM attempts to return a decoded certificate or nil if the encoded input does not contain a certificate.
func DecodePrivateKeyPEM ¶
DecodePrivateKeyPEM attempts to return a decoded key or nil if the encoded input does not contain a private key.
func EncodeCertPEM ¶
func EncodeCertPEM(cert *x509.Certificate) []byte
EncodeCertPEM returns PEM-endcoded certificate data.
func EncodePrivateKeyPEM ¶
func EncodePrivateKeyPEM(key *rsa.PrivateKey) []byte
EncodePrivateKeyPEM returns PEM-encoded private key data.
func EncodePublicKeyPEM ¶
EncodePublicKeyPEM returns PEM-encoded public key data.
func NewCA ¶
func NewCA(config *certutil.Config) (*x509.Certificate, *rsa.PrivateKey, error)
NewCA creates new certificate and private key for the certificate authority.
func NewCertAndKey ¶
func NewCertAndKey(caCert *x509.Certificate, caKey crypto.Signer, config *certutil.Config) (*x509.Certificate, *rsa.PrivateKey, error)
NewCertAndKey creates new certificate and key by passing the certificate authority certificate and key
func NewPrivateKey ¶
func NewPrivateKey() (*rsa.PrivateKey, error)
NewPrivateKey creates an RSA private key.
func NewPubAndKey ¶
func NewPubAndKey() (*rsa.PublicKey, *rsa.PrivateKey, error)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.