autocert

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2018 License: MIT Imports: 12 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(keyReader io.Reader, opts ...AutoCertOption) (tls.Certificate, error)

AutoCert generates a self-signed cert using the specified keyReader for a source for private key generation

Types

type AutoCertOption

type AutoCertOption func(*x509.Certificate)

func CommonName

func CommonName(cn string) AutoCertOption

CommonName sets the commont name of the certificate

func DNSNames

func DNSNames(dnsNames []string) AutoCertOption

DNSNames sets the DNS names of the cert

func IPAddresses

func IPAddresses(ips []net.IP) AutoCertOption

IPAddresses sets the IPAddresses of the cert

func Organization

func Organization(o []string) AutoCertOption

Organization sets the Organization(s) of the cert subject

func OrganizationalUnit

func OrganizationalUnit(ou []string) AutoCertOption

OrganizationalUnit sets the OrganizationalUnit(s) of the cert subject

func SerialNumber

func SerialNumber(sn int64) AutoCertOption

SerialNummber sets the serial number for the cert

func URIs

func URIs(uris []*url.URL) AutoCertOption

URIs sets the URIs of the cert

func ValidTimes

func ValidTimes(notBefore time.Time, notAfter time.Time) AutoCertOption

ValidTimes sets the times in which this cert is valid

type InsecureGlobalStatic

type InsecureGlobalStatic struct{}

InsecureGlobalStatic is a non-random byte reader that can be used to generaate an insecure private key This will generate the same bytes on every box (all zeros). It is horribly insecure.

func InsecureGlobalStaticReader

func InsecureGlobalStaticReader() InsecureGlobalStatic

func (InsecureGlobalStatic) Read

func (r InsecureGlobalStatic) Read(s []byte) (int, error)

type InsecureString

type InsecureString struct {
	// contains filtered or unexported fields
}

InsecureString is a non-random bytes reader that can be used to generate an insecure private key based on a provided string The upside of this is that the same string input should yield the same bytes so you can send in something like the hostname and it will generate the same output everytime you run your program. The downside is that it is very insecure and should only be used for testing

func InsecureStringReader

func InsecureStringReader(seed string) *InsecureString

func (*InsecureString) Read

func (r *InsecureString) Read(s []byte) (int, error)

Jump to

Keyboard shortcuts

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