Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Certs ¶
type Certs struct { Root *x509.Certificate Intermediates []*x509.Certificate }
type ClientCert ¶
type ClientCert struct {
// contains filtered or unexported fields
}
ClientCert is the client certificate structure
func NewClientCert ¶
func NewClientCert(pkcs12s string, pass string, b64 bool) (*ClientCert, error)
NewClientCert creates a new client certificate using the pkcs12 string 'pkcs12s' and passphrase 'pass' It returns the client certificate object and an error itself
func (*ClientCert) PrivateKeyPEMEnc ¶
func (cc *ClientCert) PrivateKeyPEMEnc() (pemb []byte, pwd string, err error)
PrivateKeyPEMEnc gets the private key in encrypted PEM format It returns the PEM format for the private key, the password protecting it and an error The password is automatically generated by generating random bytes using crypto/rand ... and then feeding it to base64 encoding
func (*ClientCert) ToPEM ¶
func (cc *ClientCert) ToPEM() []byte
ToPEM generates the PEM bytes for the client certificate
func (*ClientCert) Validity ¶
func (cc *ClientCert) Validity() time.Time
Validity returns until when the client certificate is valid Before this time the certificate should thus be renewed by running the client again