Documentation ¶
Index ¶
Constants ¶
View Source
const ( RootCaPath = "root.crt" RootKeyPath = "root.key" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Certificate ¶
type Certificate struct { RootKey *rsa.PrivateKey RootCa *x509.Certificate RootCaStr []byte RootKeyStr []byte RootPath string }
func NewCertificate ¶
func NewCertificate(rootPath string) (*Certificate, error)
func (*Certificate) GenerateKey ¶
func (c *Certificate) GenerateKey() (*rsa.PrivateKey, error)
func (*Certificate) GeneratePem ¶
func (c *Certificate) GeneratePem(host string, subject pkix.Name, isRoot ...bool) (*pem.Block, *pem.Block, error)
GeneratePem generate pem By default, a child certificate is generated. If you need to generate a root certificate, please pass in the third parameter as true, or do not set RootCa and RootKey
Click to show internal directories.
Click to hide internal directories.