Documentation ¶
Index ¶
- Constants
- Variables
- func NewPrivateKey() (*rsa.PrivateKey, error)
- func NewSelfSignedCACertificate(cfg CACertConfig, key *rsa.PrivateKey) (*x509.Certificate, error)
- func NewSignedClientCertificate(cfg ClientCertConfig, key *rsa.PrivateKey, caCert *x509.Certificate, ...) (*x509.Certificate, error)
- func NewSignedServerCertificate(cfg ServerCertConfig, key *rsa.PrivateKey, caCert *x509.Certificate, ...) (*x509.Certificate, error)
- func WriteCertificatePEMBlock(out io.Writer, cert *x509.Certificate) error
- func WritePrivateKeyPEMBlock(out io.Writer, key *rsa.PrivateKey) error
- type CACertConfig
- type ClientCertConfig
- type ServerCertConfig
Constants ¶
View Source
const (
RSAKeySize = 2048
)
Variables ¶
View Source
var ( Duration90d = time.Hour * 24 * 90 Duration365d = time.Hour * 24 * 365 )
Functions ¶
func NewPrivateKey ¶
func NewPrivateKey() (*rsa.PrivateKey, error)
func NewSelfSignedCACertificate ¶
func NewSelfSignedCACertificate(cfg CACertConfig, key *rsa.PrivateKey) (*x509.Certificate, error)
func NewSignedClientCertificate ¶
func NewSignedClientCertificate(cfg ClientCertConfig, key *rsa.PrivateKey, caCert *x509.Certificate, caKey *rsa.PrivateKey) (*x509.Certificate, error)
func NewSignedServerCertificate ¶
func NewSignedServerCertificate(cfg ServerCertConfig, key *rsa.PrivateKey, caCert *x509.Certificate, caKey *rsa.PrivateKey) (*x509.Certificate, error)
func WriteCertificatePEMBlock ¶
func WriteCertificatePEMBlock(out io.Writer, cert *x509.Certificate) error
func WritePrivateKeyPEMBlock ¶
func WritePrivateKeyPEMBlock(out io.Writer, key *rsa.PrivateKey) error
Types ¶
type CACertConfig ¶
type ClientCertConfig ¶
type ServerCertConfig ¶
Click to show internal directories.
Click to hide internal directories.