Documentation ¶
Index ¶
- func IsRootCA(cert *x509.Certificate) bool
- func ParsePrivateKey(pemBlock []byte) (*ecdsa.PrivateKey, error)
- func ParseX509(pemBlock []byte) ([]*x509.Certificate, error)
- func ReadPrivateKey(path string) (*ecdsa.PrivateKey, error)
- func ReadX509(path string) ([]*x509.Certificate, error)
- func Verify(certificates []*x509.Certificate, certificateAuthorities []*x509.Certificate, ...) ([][]*x509.Certificate, error)
- type CertificateInfo
- type Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsRootCA ¶ added in v2.13.0
func IsRootCA(cert *x509.Certificate) bool
func ParsePrivateKey ¶ added in v2.13.0
func ParsePrivateKey(pemBlock []byte) (*ecdsa.PrivateKey, error)
ParsePrivateKey parses certificates from PEM format
func ParseX509 ¶ added in v2.13.0
func ParseX509(pemBlock []byte) ([]*x509.Certificate, error)
ParseX509 parses certificates from PEM format
func ReadPrivateKey ¶ added in v2.13.0
func ReadPrivateKey(path string) (*ecdsa.PrivateKey, error)
ReadPrivateKey reads private key from file in PEM format
func ReadX509 ¶ added in v2.13.0
func ReadX509(path string) ([]*x509.Certificate, error)
ReadFile reads certificates from file in PEM format
func Verify ¶ added in v2.13.0
func Verify(certificates []*x509.Certificate, certificateAuthorities []*x509.Certificate, useSystemRoots bool, opts x509.VerifyOptions) ([][]*x509.Certificate, error)
Verify verifies certificate against certificate authorities.
Types ¶
type CertificateInfo ¶
type CertificateInfo struct { SubjectName string `json:"subjectName,omitempty"` Organization []string `json:"organization,omitempty"` IssuerName string `json:"issuerName,omitempty"` IssuerOrganization []string `json:"issuerOrganization,omitempty"` NotAfter time.Time `json:"notAfter,omitempty"` NotBefore time.Time `json:"notBefore,omitempty"` SerialNumber string `json:"serialNumber,omitempty"` }
func ParseCertificate ¶
func ParseCertificate(cert *x509.Certificate) *CertificateInfo
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
func (*Error) Chains ¶
func (e *Error) Chains() [][]*x509.Certificate
func (*Error) LeafCertificateInfo ¶
func (e *Error) LeafCertificateInfo() *CertificateInfo
Click to show internal directories.
Click to hide internal directories.