common

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2021 License: Apache-2.0 Imports: 13 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 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