Documentation ¶
Index ¶
- func CheckKnownRevocation(verifiedChain []*x509.Certificate) (bool, error)
- func CheckRecovation(verifiedChain []*x509.Certificate) (bool, error)
- func CheckSignatures(name string, chain []*x509.Certificate) ([]*x509.Certificate, error)
- func FullCheck(name string, chain []*x509.Certificate) (bool, error)
- func FullCheckBytes(name string, certBytes [][]byte) (bool, error)
- func GetOrFetchCert(urls []string) (*x509.Certificate, error)
- func GetOrFetchIssuer(cert *x509.Certificate) (*x509.Certificate, error)
- func ImportCert(urls []string) (*x509.Certificate, error)
- func ParsePEMCertificate(certPEM []byte) (*x509.Certificate, error)
- func UpdateCRL(caInfo *CARevocationInfo, ca *x509.Certificate, caID string) error
- type CARevocationInfo
- func (m *CARevocationInfo) Create(name string) error
- func (m *CARevocationInfo) CreateInNamespace(namespace string, name string) error
- func (m *CARevocationInfo) CreateRevokedCert(cert *Cert, serialNumber *big.Int) error
- func (m *CARevocationInfo) GetRevokedCert(serialNumber *big.Int) (*Cert, error)
- func (m *CARevocationInfo) Save() error
- func (m *CARevocationInfo) UpdateCRLDistributionPoints(newCRLDistributionPoints []string)
- type Cert
- func GetCertFromNamespace(namespace string, name string) (*Cert, error)
- func GetCertWithSPKI(spki []byte) (*Cert, error)
- func GetCertWithURL(url string) (*Cert, error)
- func GetRevokedCert(caID string, serialNumber *big.Int) (*Cert, error)
- func UpdateOCSP(rCert *Cert, cert, ca *x509.Certificate, caID string) (*Cert, error)
- func (m *Cert) CreateInNamespace(namespace string, name string) error
- func (m *Cert) CreateRevokedCert(caID string, serialNumber *big.Int) error
- func (m *Cert) CreateWithSPKI(spki []byte) error
- func (m *Cert) CreateWithUrl(url string) error
- func (m *Cert) GetCertificate() (*x509.Certificate, error)
- func (m *Cert) IsRevoked(hardFail bool) bool
- func (m *Cert) RevocationStatus(hardFail bool) string
- func (m *Cert) Save() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckKnownRevocation ¶
func CheckKnownRevocation(verifiedChain []*x509.Certificate) (bool, error)
func CheckRecovation ¶
func CheckRecovation(verifiedChain []*x509.Certificate) (bool, error)
func CheckSignatures ¶
func CheckSignatures(name string, chain []*x509.Certificate) ([]*x509.Certificate, error)
func FullCheck ¶
func FullCheck(name string, chain []*x509.Certificate) (bool, error)
FullCheck does a full certificate check. Calls CheckSignatures, CheckRecovation and CheckCertificateTransparency(TODO).
func FullCheckBytes ¶
FullCheckBytes does a full certificate check, certificates are provided as raw bytes. It parses the raw certificates and calls FullCheck.
func GetOrFetchCert ¶
func GetOrFetchCert(urls []string) (*x509.Certificate, error)
func GetOrFetchIssuer ¶
func GetOrFetchIssuer(cert *x509.Certificate) (*x509.Certificate, error)
func ImportCert ¶
func ImportCert(urls []string) (*x509.Certificate, error)
func ParsePEMCertificate ¶
func ParsePEMCertificate(certPEM []byte) (*x509.Certificate, error)
ParsePEMCertificate parses and returns a PEM-encoded certificate, can handle PEM encoded PKCS #7 structures.
func UpdateCRL ¶
func UpdateCRL(caInfo *CARevocationInfo, ca *x509.Certificate, caID string) error
UpdateCRL fetches and imports the CRL belonging to a CA, if expired.
Types ¶
type CARevocationInfo ¶
type CARevocationInfo struct { record.Record CRLDistributionPoints []string OCSPServers []string CertificateURLs []string LastCRLUpdate int64 NextCRLUpdate int64 Raw []byte Expires int64 // contains filtered or unexported fields }
CARevocationInfo saves Information on revokation of Certificates of a Certificate Authority.
func GetCARevocationInfo ¶
func GetCARevocationInfo(name string) (*CARevocationInfo, error)
GetCARevocationInfo fetches CARevocationInfo with the provided name from the default namespace.
func GetCARevocationInfoFromNamespace ¶
func GetCARevocationInfoFromNamespace(namespace string, name string) (*CARevocationInfo, error)
GetCARevocationInfoFromNamespace fetches CARevocationInfo with the provided name from the provided namespace.
func (*CARevocationInfo) Create ¶
func (m *CARevocationInfo) Create(name string) error
Create saves CARevocationInfo with the provided name in the default namespace.
func (*CARevocationInfo) CreateInNamespace ¶
func (m *CARevocationInfo) CreateInNamespace(namespace string, name string) error
CreateInNamespace saves CARevocationInfo with the provided name in the provided namespace.
func (*CARevocationInfo) CreateRevokedCert ¶
func (m *CARevocationInfo) CreateRevokedCert(cert *Cert, serialNumber *big.Int) error
func (*CARevocationInfo) GetRevokedCert ¶
func (m *CARevocationInfo) GetRevokedCert(serialNumber *big.Int) (*Cert, error)
func (*CARevocationInfo) Save ¶
func (m *CARevocationInfo) Save() error
Save saves CARevocationInfo.
func (*CARevocationInfo) UpdateCRLDistributionPoints ¶
func (m *CARevocationInfo) UpdateCRLDistributionPoints(newCRLDistributionPoints []string)
UpdateCRLDistributionPoints updates the CRL Distribution Points with new urls
type Cert ¶
type Cert struct { record.Record Raw []byte RevokedWithCRL bool `*:",omitempty"` RevokedWithOneCRL bool `*:",omitempty"` RevokedWithCRLSet bool `*:",omitempty"` RevokedWithOCSP bool `*:",omitempty"` OCSPFailed bool NextOCSPUpdate int64 LastSeen int64 Expires int64 // contains filtered or unexported fields }
Cert saves a certificate.
func GetCertFromNamespace ¶
GetCertFromNamespace gets Cert with the provided name from the provided namespace.
func GetCertWithSPKI ¶
GetCertWithSPKI fetches Cert from the default namespace using the certificate SPKI as the key.
func GetCertWithURL ¶
GetCertWithURL fetches Cert from the default namespace using the certificate URL as the key.
func GetRevokedCert ¶
GetRevokedCert gets Cert from its CA's namespace with its Serial Number
func UpdateOCSP ¶
func (*Cert) CreateInNamespace ¶
CreateInNamespace saves Cert with the provided name in the provided namespace.
func (*Cert) CreateRevokedCert ¶
CreateRevokedCert creates a new Cert in its CA's namespace with its Serial Number
func (*Cert) CreateWithSPKI ¶
CreateWithSPKI saves Cert in the default namespace using the certificate SPKI as the key.
func (*Cert) CreateWithUrl ¶
CreateWithUrl saves Cert in the default namespace using the certificate URL as the key.
func (*Cert) GetCertificate ¶
func (m *Cert) GetCertificate() (*x509.Certificate, error)
GetCertificate returns the underlying x509.Certificate
func (*Cert) RevocationStatus ¶
RevocationStatus returns the status of the certificate in form of a string to be appended to something like "The certificate is ".