x509

package
v2.21.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 11, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

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 NewError

func NewError(chains [][]*x509.Certificate, err error) *Error

func (*Error) Chains

func (e *Error) Chains() [][]*x509.Certificate

func (*Error) Error

func (e *Error) Error() string

func (*Error) LeafCertificateInfo

func (e *Error) LeafCertificateInfo() *CertificateInfo

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL