Documentation ¶
Index ¶
- func GenerateCertificate(option GenCertOption) ([]byte, []byte, *x509.Certificate, error)
- func GenerateTestCertSuite() ([]byte, []byte, []byte, error)
- func ReadWithZlib(conn io.Reader, data interface{}) error
- func StripDNSPort(dnsName string) string
- func WriteWithZlib(conn io.Writer, data interface{}) error
- type GenCertOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateCertificate ¶
func GenerateCertificate(option GenCertOption) ([]byte, []byte, *x509.Certificate, error)
GenerateCertificate returns a private key, a public key and the certificate generated under `option`.
func GenerateTestCertSuite ¶
GenerateTestCertSuite returns a 10 years certificate. Returns CA, server private key, server public key, error in order.
func ReadWithZlib ¶
ReadWithZlib reads data from conn, returns any error encountered.
func StripDNSPort ¶ added in v0.0.24
StripDNSPort strips out the port part of the DNSName.
func WriteWithZlib ¶
WriteWithZlib dumps data into conn, returns any error encountered.
Types ¶
type GenCertOption ¶
type GenCertOption struct { DNSName string CertName string KeyLength int IsCA bool CACertificate x509.Certificate CAPriv []byte CAPub []byte }
GenCertOption specifies parameters to generate certificates.
Click to show internal directories.
Click to hide internal directories.