Documentation ¶
Index ¶
- Variables
- func Author() string
- func GenerateCertificate(c Certificate) ([]byte, *rsa.PrivateKey, error)
- func License() string
- func ReadCertificate(name string) ([]*x509.Certificate, *rsa.PrivateKey, error)
- func Version() string
- func WriteCertificate(name string, certificate []byte, key *rsa.PrivateKey) error
- type Certificate
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidCertificate is invalid certificate error ErrInvalidCertificate = errors.New("selfca: the certificate is invalid") // ErrInvalidCertificateKey is invalid certificate key error ErrInvalidCertificateKey = errors.New("selfca: the certificate key is invalid") )
Functions ¶
func GenerateCertificate ¶
func GenerateCertificate(c Certificate) ([]byte, *rsa.PrivateKey, error)
GenerateCertificate generates X.509 certificate and key
func ReadCertificate ¶ added in v0.6.0
func ReadCertificate(name string) ([]*x509.Certificate, *rsa.PrivateKey, error)
ReadCertificate reads certificate and key from files
func WriteCertificate ¶ added in v0.4.0
func WriteCertificate(name string, certificate []byte, key *rsa.PrivateKey) error
WriteCertificate writes certificate and key to files
Types ¶
type Certificate ¶
type Certificate struct { IsCA bool CommonName string KeySize int NotBefore time.Time NotAfter time.Time Hosts []string CAKey *rsa.PrivateKey CACertificate *x509.Certificate }
Certificate stors certificate information for generating
Click to show internal directories.
Click to hide internal directories.