Documentation ¶
Index ¶
- func New(keyReader io.Reader, opts ...AutoCertOption) (tls.Certificate, error)
- type AutoCertOption
- func CommonName(cn string) AutoCertOption
- func DNSNames(dnsNames []string) AutoCertOption
- func IPAddresses(ips []net.IP) AutoCertOption
- func Organization(o []string) AutoCertOption
- func OrganizationalUnit(ou []string) AutoCertOption
- func SerialNumber(sn int64) AutoCertOption
- func URIs(uris []*url.URL) AutoCertOption
- func ValidTimes(notBefore time.Time, notAfter time.Time) AutoCertOption
- type InsecureGlobalStatic
- type InsecureString
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 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
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