Documentation ¶
Index ¶
- func HexSHA256(cert []byte) string
- func ParsePEM(data []byte, secret string) ([]*pem.Block, error)
- func ParsePEMCertificate(data []byte, secret string) (*tls.Certificate, error)
- 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)
- 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
- type StorageHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParsePEMCertificate ¶
func ParsePEMCertificate(data []byte, secret string) (*tls.Certificate, error)
Types ¶
type CertificateManager ¶
type CertificateManager struct {
// contains filtered or unexported fields
}
func NewCertificateManager ¶
func NewCertificateManager(storage StorageHandler, secret string, logger *logrus.Logger) *CertificateManager
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)
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 )
type StorageHandler ¶
type StorageHandler interface { GetKey(string) (string, error) SetKey(string, string, int64) error GetKeys(string) []string DeleteKey(string) bool DeleteScanMatch(string) bool }
StorageHandler is a standard interface to a storage backend, used by AuthorisationManager to read and write key values to the backend
Click to show internal directories.
Click to hide internal directories.