Documentation ¶
Index ¶
- func CertificateType(cert *x509.Certificate) string
- func DecodeCertificatesPEM(data []byte) ([]*x509.Certificate, error)
- func ExtKeyUsageToString(extKeyUsage []x509.ExtKeyUsage) []string
- func IsRoot(cert *x509.Certificate) bool
- func KeyUsageToString(keyUsage x509.KeyUsage) []string
- func ValidityFormat(t time.Time) string
- type Certificate
- type CertificateLocation
- func LoadCertificate(fileName string, data []byte) (CertificateLocation, error)
- func LoadCertificateFromStdin() (CertificateLocation, error)
- func LoadCertificatesFromFile(fileName string) (CertificateLocation, error)
- func LoadCertificatesFromNetwork(addr string, tlsSkipVerify bool) (CertificateLocation, error)
- type Certificates
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CertificateType ¶
func CertificateType(cert *x509.Certificate) string
func DecodeCertificatesPEM ¶
func DecodeCertificatesPEM(data []byte) ([]*x509.Certificate, error)
func ExtKeyUsageToString ¶
func ExtKeyUsageToString(extKeyUsage []x509.ExtKeyUsage) []string
ExtKeyUsageToString converts extended key usage integer values to strings
func IsRoot ¶
func IsRoot(cert *x509.Certificate) bool
func KeyUsageToString ¶
KeyUsageToString converts key usage bit values to strings
func ValidityFormat ¶
Types ¶
type Certificate ¶
type Certificate struct { // position of certificate in the chain, starts with 0 Index int X509Certificate *x509.Certificate }
func (Certificate) IsExpired ¶
func (c Certificate) IsExpired() bool
func (Certificate) IsExpiredAt ¶
func (c Certificate) IsExpiredAt(t time.Time) bool
func (Certificate) String ¶
func (c Certificate) String() string
func (Certificate) ToPEM ¶
func (c Certificate) ToPEM() []byte
type CertificateLocation ¶
type CertificateLocation struct { TLSVersion uint16 // only applicable for network certificates Path string Certificates Certificates VerifiedChains []Certificates // only applicable for network certificates }
func LoadCertificate ¶
func LoadCertificate(fileName string, data []byte) (CertificateLocation, error)
func LoadCertificateFromStdin ¶
func LoadCertificateFromStdin() (CertificateLocation, error)
func LoadCertificatesFromFile ¶
func LoadCertificatesFromFile(fileName string) (CertificateLocation, error)
func LoadCertificatesFromNetwork ¶
func LoadCertificatesFromNetwork(addr string, tlsSkipVerify bool) (CertificateLocation, error)
type Certificates ¶
type Certificates []Certificate
func FromBytes ¶
func FromBytes(data []byte) (Certificates, error)
FromBytes converts raw certificate bytes to certificate, if the supplied data is cert bundle (or chain) all the certificates will be returned
func FromX509Certificates ¶
func FromX509Certificates(cs []*x509.Certificate) Certificates
Click to show internal directories.
Click to hide internal directories.