Documentation ¶
Index ¶
- func GenerateCACertificate(subject pkix.Name, privateKey *rsa.PrivateKey) (template *x509.Certificate, cert tls.Certificate, certPem []byte, ...)
- func GenerateCertificate(subject pkix.Name, dnsNames []string, ipAddresses []net.IP, ...) (cert tls.Certificate, err error)
- func GenerateCertificateWithPEM(subject pkix.Name, dnsNames []string, ipAddresses []net.IP, ...) (cert tls.Certificate, certPem []byte, keyPem []byte, err error)
- func GeneratePrivateKey() (*rsa.PrivateKey, error)
- func GetClientMTlsConfig(certPath, keyPath, caPath, hostname string) (*tls.Config, error)
- func GetClientTlsConfig(caPath, hostname string) (*tls.Config, error)
- func GetInsecureTlsConfig() *tls.Config
- func GetServerMTlsConfig(certPath, keyPath, caPath string) (*tls.Config, error)
- func GetServerTlsConfig(certPath, keyPath string) (*tls.Config, error)
- func LoadCACertificate(certPath, keyPath string) (caCert *x509.Certificate, caPriKey *rsa.PrivateKey, err error)
- type CertPool
- type PriKeyPool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateCACertificate ¶
func GenerateCACertificate(subject pkix.Name, privateKey *rsa.PrivateKey) (template *x509.Certificate, cert tls.Certificate, certPem []byte, keyPem []byte, err error)
func GenerateCertificate ¶
func GenerateCertificate(subject pkix.Name, dnsNames []string, ipAddresses []net.IP, caCertTemplate *x509.Certificate, caPrivateKey, privateKey *rsa.PrivateKey) (cert tls.Certificate, err error)
func GenerateCertificateWithPEM ¶
func GenerateCertificateWithPEM(subject pkix.Name, dnsNames []string, ipAddresses []net.IP, caCertTemplate *x509.Certificate, caPrivateKey, privateKey *rsa.PrivateKey) (cert tls.Certificate, certPem []byte, keyPem []byte, err error)
func GeneratePrivateKey ¶
func GeneratePrivateKey() (*rsa.PrivateKey, error)
func GetClientMTlsConfig ¶
func GetClientTlsConfig ¶
client tls need ca file and Common name
func GetInsecureTlsConfig ¶
func GetServerMTlsConfig ¶
func GetServerTlsConfig ¶
server tls need cert file and key file
func LoadCACertificate ¶
func LoadCACertificate(certPath, keyPath string) (caCert *x509.Certificate, caPriKey *rsa.PrivateKey, err error)
Types ¶
type PriKeyPool ¶
type PriKeyPool struct {
// contains filtered or unexported fields
}
func NewPriKeyPool ¶
func NewPriKeyPool(maxSize int) *PriKeyPool
func (*PriKeyPool) Get ¶
func (p *PriKeyPool) Get() (*rsa.PrivateKey, error)
Click to show internal directories.
Click to hide internal directories.