Documentation
¶
Index ¶
- Variables
- func GenCertificate(template *x509.Certificate, setLeaf bool) ([]byte, []byte, []byte, tls.Certificate)
- func GenServerCertificate() ([]byte, []byte, []byte, tls.Certificate)
- func GetCertIDAndChainPEM(certData []byte, secret string) (string, []byte, error)
- func HexSHA256(cert []byte) string
- func ParsePEM(data []byte, secret string) ([]*pem.Block, error)
- func ParsePEMCertificate(data []byte, secret string) (*tls.Certificate, error)
- type CertificateBasics
- type CertificateManager
- func (c *CertificateManager) Add(certData []byte, orgID string) (string, error)
- func (c *CertificateManager) CertPool(certIDs []string) *x509.CertPool
- func (c *CertificateManager) Delete(certID string, orgID string)
- func (c *CertificateManager) FlushCache()
- func (c *CertificateManager) GetRaw(certID string) (string, error)
- func (c *CertificateManager) List(certIDs []string, mode CertificateType) (out []*tls.Certificate)
- func (c *CertificateManager) ListAllIds(prefix string) (out []string)
- func (c *CertificateManager) ListPublicKeys(keyIDs []string) (out []string)
- func (c *CertificateManager) ListRawPublicKey(keyID string) (out interface{})
- func (c *CertificateManager) ValidateRequestCertificate(certIDs []string, r *http.Request) error
- type CertificateMeta
- type CertificateType
Constants ¶
This section is empty.
Variables ¶
View Source
var CertManagerLogPrefix = "cert_storage"
Functions ¶
func GenCertificate ¶
func GenCertificate(template *x509.Certificate, setLeaf bool) ([]byte, []byte, []byte, tls.Certificate)
func GenServerCertificate ¶
func GenServerCertificate() ([]byte, []byte, []byte, tls.Certificate)
func GetCertIDAndChainPEM ¶
func ParsePEMCertificate ¶
func ParsePEMCertificate(data []byte, secret string) (*tls.Certificate, error)
Types ¶
type CertificateBasics ¶
type CertificateBasics struct {
ID string `json:"id"`
IssuerCN string `json:"issuer_cn"`
SubjectCN string `json:"subject_cn"`
DNSNames []string `json:"dns_names"`
HasPrivateKey bool `json:"has_private"`
NotBefore time.Time `json:"not_before"`
NotAfter time.Time `json:"not_after"`
}
func ExtractCertificateBasics ¶
func ExtractCertificateBasics(cert *tls.Certificate, certID string) *CertificateBasics
type CertificateManager ¶
type CertificateManager struct {
// contains filtered or unexported fields
}
func NewCertificateManager ¶
func NewSlaveCertManager ¶
func (*CertificateManager) Add ¶
func (c *CertificateManager) Add(certData []byte, orgID string) (string, error)
func (*CertificateManager) CertPool ¶
func (c *CertificateManager) CertPool(certIDs []string) *x509.CertPool
func (*CertificateManager) Delete ¶
func (c *CertificateManager) Delete(certID string, orgID string)
func (*CertificateManager) FlushCache ¶
func (c *CertificateManager) FlushCache()
func (*CertificateManager) GetRaw ¶
func (c *CertificateManager) GetRaw(certID string) (string, error)
func (*CertificateManager) List ¶
func (c *CertificateManager) List(certIDs []string, mode CertificateType) (out []*tls.Certificate)
func (*CertificateManager) ListAllIds ¶
func (c *CertificateManager) ListAllIds(prefix string) (out []string)
func (*CertificateManager) ListPublicKeys ¶
func (c *CertificateManager) ListPublicKeys(keyIDs []string) (out []string)
Returns list of fingerprints
func (*CertificateManager) ListRawPublicKey ¶
func (c *CertificateManager) ListRawPublicKey(keyID string) (out interface{})
Returns list of fingerprints
func (*CertificateManager) ValidateRequestCertificate ¶
func (c *CertificateManager) ValidateRequestCertificate(certIDs []string, r *http.Request) error
type CertificateMeta ¶
type CertificateMeta struct {
ID string `json:"id"`
Fingerprint string `json:"fingerprint"`
HasPrivateKey bool `json:"has_private"`
Issuer pkix.Name `json:"issuer,omitempty"`
Subject pkix.Name `json:"subject,omitempty"`
NotBefore time.Time `json:"not_before,omitempty"`
NotAfter time.Time `json:"not_after,omitempty"`
DNSNames []string `json:"dns_names,omitempty"`
}
func ExtractCertificateMeta ¶
func ExtractCertificateMeta(cert *tls.Certificate, certID string) *CertificateMeta
type CertificateType ¶
type CertificateType int
const ( CertificatePrivate CertificateType = iota CertificatePublic CertificateAny )
Click to show internal directories.
Click to hide internal directories.