common

package
v0.0.39 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 31, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

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

func GenerateTestCertSuite() ([]byte, []byte, []byte, error)

GenerateTestCertSuite returns a 10 years certificate. Returns CA, server private key, server public key, error in order.

func ReadWithZlib

func ReadWithZlib(conn io.Reader, data interface{}) error

ReadWithZlib reads data from conn, returns any error encountered.

func StripDNSPort added in v0.0.24

func StripDNSPort(dnsName string) string

StripDNSPort strips out the port part of the DNSName.

func WriteWithZlib

func WriteWithZlib(conn io.Writer, data interface{}) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL