Documentation ¶
Index ¶
- func NewCATemplate(name string) *x509.Certificate
- func NewClientTemplate(cn string, org string) *x509.Certificate
- func NewServerTemplate(names []string, ips []net.IP) *x509.Certificate
- type CSR
- type Cert
- type CertIO
- type Certificate
- func (c *Certificate) CSRPEM() *pem.Block
- func (c *Certificate) CertPEM() *pem.Block
- func (c *Certificate) CertPath() string
- func (c *Certificate) KeyPEM() *pem.Block
- func (c *Certificate) KeyPath() string
- func (c *Certificate) Load() error
- func (c *Certificate) MakeCSR(template *x509.Certificate) error
- func (c *Certificate) MakeKey() error
- func (c *Certificate) Save() error
- func (c *Certificate) SelfSign(template *x509.Certificate) error
- func (c *Certificate) Sign(s *Certificate, template *x509.Certificate) error
- func (c *Certificate) Signer() crypto.Signer
- type FileBundle
- type FileIO
- func (f FileIO) CSRPath() string
- func (f FileIO) CertPath() string
- func (f FileIO) KeyPath() string
- func (f FileIO) Load(path string) ([]byte, error)
- func (f FileIO) LoadCSR() ([]byte, error)
- func (f FileIO) LoadCert() ([]byte, error)
- func (f FileIO) LoadKey() ([]byte, error)
- func (f FileIO) Save(block *pem.Block, path string) error
- func (f FileIO) SaveCSR(block *pem.Block) error
- func (f FileIO) SaveCert(block *pem.Block) error
- func (f FileIO) SaveKey(block *pem.Block) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCATemplate ¶
func NewCATemplate(name string) *x509.Certificate
func NewClientTemplate ¶
func NewClientTemplate(cn string, org string) *x509.Certificate
func NewServerTemplate ¶
func NewServerTemplate(names []string, ips []net.IP) *x509.Certificate
Types ¶
type CSR ¶
type CSR struct {
*x509.CertificateRequest
}
func (*CSR) MarshalJSON ¶
func (*CSR) UnmarshalJSON ¶
type Cert ¶
type Cert struct {
*x509.Certificate
}
Type aliases for JSON serialization (see json.go)
func (*Cert) MarshalJSON ¶
func (*Cert) UnmarshalJSON ¶
type Certificate ¶
type Certificate struct { Key *ecdsa.PrivateKey `json:"-"` Cert *Cert `json:"cert"` CSR *CSR `json:"csr"` IO CertIO `json:"-"` }
Certificate (request) and associated keypair Only supports ECDSA certificates for sign and auth
func (*Certificate) CertPath ¶
func (c *Certificate) CertPath() string
Get the certificate file path
func (*Certificate) MakeCSR ¶
func (c *Certificate) MakeCSR(template *x509.Certificate) error
Generate a CSR if necessary (no available cert)
func (*Certificate) SelfSign ¶
func (c *Certificate) SelfSign(template *x509.Certificate) error
Self sign a certificate if necessary
func (*Certificate) Sign ¶
func (c *Certificate) Sign(s *Certificate, template *x509.Certificate) error
Sign another certificate
type FileBundle ¶
type FileBundle struct {
Path string
}
func NewFileBundle ¶
func NewFileBundle(path string) (*FileBundle, error)
func (*FileBundle) GetCA ¶
func (b *FileBundle) GetCA(name string) (*Certificate, error)
func (*FileBundle) GetCertOrCSR ¶
func (b *FileBundle) GetCertOrCSR(name string, template *x509.Certificate) (*Certificate, error)
func (*FileBundle) GetCertWithKey ¶
func (b *FileBundle) GetCertWithKey(name string) (*Certificate, error)
func (*FileBundle) GetCertificate ¶
func (b *FileBundle) GetCertificate(name string) *Certificate
Click to show internal directories.
Click to hide internal directories.