Documentation ¶
Overview ¶
some parts from https://github.com/jsha/minica/blob/master/main.go
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( KeyPath = "" CertPath = "" )
Functions ¶
func ExampleUsage ¶
func ExampleUsage()
Types ¶
type Cert ¶
type Cert struct {
// contains filtered or unexported fields
}
func New ¶
func New(path, organization, domainIPCombo, validFrom, ecdsaCurve string, validFor *time.Duration, isCA bool, rsaBits int) *Cert
New Certificate/Key
path... where to store once created organization... "Acme Co" domainIPCombo.. "localhost/127.0.0.1" validFrom... "Jan 1 15:04:05 2011" ecdsaCurve... empty for RSA otherwise P256 recommended validFor... some time.X Duration isCA... become it's own certificate authority rsaBits... default 2048, ignored if using ecdsaCurve instead of RSA
func (*Cert) CreateCert ¶
CreateCert used to create self signed certificates domain Comma-separated hostnames and IPs to generate a certificate for (default localhost/127.0.0.1) certValidFrom Creation date formatted as Jan 1 15:04:05 2011 (default time.now() ) certValidFor Duration that certificate is valid for (default 1 yr) rsaBits Size of RSA key to generate. Ignored if --ecdsa-curve is set (default 2048) ecdsaCurve ECDSA curve to use to generate a key. Valid values are P224, P256 (recommended), P384, P521 isCA whether this cert should be its own Certificate Authority (default false)