Documentation
¶
Index ¶
- func BestNamedCertificate(c *tls.Config, clientHello *tls.ClientHelloInfo) (*tls.Certificate, bool)
- func GenerateRootCA(certPath, keyPath string) error
- func GenerateSelfSignedCert(certPath, keyPath string) error
- func ParseCertificate(pemPath string) (*x509.Certificate, error)
- func VerifyCertificate(cert *x509.Certificate, rootCAs *x509.CertPool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BestNamedCertificate ¶
func BestNamedCertificate(c *tls.Config, clientHello *tls.ClientHelloInfo) (*tls.Certificate, bool)
BestNamedCertificate Select the best named certificate per the usual behavior if c.GetCertificate is nil, and c.NameToCertificate is not.
func GenerateSelfSignedCert ¶
生成自签名证书和私钥
func ParseCertificate ¶
func ParseCertificate(pemPath string) (*x509.Certificate, error)
解析 PEM 格式证书,提取关键信息
func VerifyCertificate ¶
func VerifyCertificate(cert *x509.Certificate, rootCAs *x509.CertPool) error
验证证书有效性(需传入根证书池)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.