Documentation
¶
Overview ¶
Package cert HTTPS证书
Package cert 证书管理
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache interface { Set(host string, c *tls.Certificate) Get(host string) *tls.Certificate }
Cache 证书缓存接口
type Certificate ¶
type Certificate struct {
// contains filtered or unexported fields
}
Certificate 证书管理
func NewCertificate ¶
func NewCertificate(cache Cache, useDefaultPrivateKey ...bool) *Certificate
func (*Certificate) GeneratePem ¶
func (c *Certificate) GeneratePem(host string, expireDays int, rootCA *x509.Certificate, rootKey *ecdsa.PrivateKey) (*Pair, error)
GeneratePem 生成证书
func (*Certificate) GenerateTlsConfig ¶
func (c *Certificate) GenerateTlsConfig(host string) (*tls.Config, error)
GenerateTlsConfig 生成TLS配置
type Pair ¶
type Pair struct { Cert *x509.Certificate CertBytes []byte PrivateKey *ecdsa.PrivateKey PrivateKeyBytes []byte }
Click to show internal directories.
Click to hide internal directories.