Documentation ¶
Index ¶
- func GenerateCert(ca *CA, name string, validFrom string, validFor time.Duration, isCA bool, ...) (cert, key []byte, err error)
- type CA
- func (ca *CA) GetNextSerial() *big.Int
- func (ca *CA) IssueCA(name, curve string, rsaBits int) (cert, key []byte, err error)
- func (ca *CA) IssueClient(name, curve string, rsaBits int) (cert, key []byte, err error)
- func (ca *CA) IssueServer(name, curve string, rsaBits int) (cert, key []byte, err error)
- type Entity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CA ¶
CA is a certificate key pair which is able to issue new client-, server- and ca-certificates
func NewSelfSignedCA ¶
NewSelfSignedCA creates a new self-signed CA // curve can be one of: * P224 * P256 * P384 * P521 rsaBits should be one of * 0 (if curve is specified) * 1024 * 2048 * 4096
func (*CA) GetNextSerial ¶
GetNextSerial returns the next free serial number and increases the internal value
func (*CA) IssueCA ¶
IssueCA issues a new ca certificate curve can be one of: * P224 * P256 * P384 * P521 rsaBits should be one of * 0 (if curve is specified) * 1024 * 2048 * 4096
func (*CA) IssueClient ¶
IssueClient issues a new client certificate curve can be one of: * P224 * P256 * P384 * P521 rsaBits should be one of * 0 (if curve is specified) * 1024 * 2048 * 4096
type Entity ¶
type Entity struct { Cert *x509.Certificate Key interface{} Algorithm x509.PublicKeyAlgorithm }
func NewEntityFromDER ¶
func NewEntityFromDER(certDer, keyDer []byte, algo x509.PublicKeyAlgorithm) (*Entity, error)