x509util

package
v0.0.0-...-af5a268 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: MIT Imports: 18 Imported by: 1

Documentation

Overview

Package x509util includes utility code for working with X.509 certificates from the x509 package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CertificateFromPEM

func CertificateFromPEM(pemBytes []byte) (*x509.Certificate, error)

CertificateFromPEM takes a certificate in PEM format and returns the corresponding x509.Certificate object.

func CertificateRequestToString

func CertificateRequestToString(cr *x509.CertificateRequest) string

CertificateRequestToString generates a string describing the given certificate request. The output roughly resembles that from openssl req -text

func CertificateToString

func CertificateToString(cert *x509.Certificate) string

CertificateToString generates a string describing the given certificate. The output roughly resembles that from openssl x509 -text.

func CertificatesFromPEM

func CertificatesFromPEM(pemBytes []byte) ([]*x509.Certificate, error)

CertificatesFromPEM parses one or more certificates from the given PEM data. The PEM certificates must be concatenated. This function can be used for parsing PEM-formatted certificate chains, but does not verify that the resulting chain is a valid certificate chain.

func ExtractSCT

func ExtractSCT(sctData *x509.SerializedSCT) (*ct.SignedCertificateTimestamp, error)

ExtractSCT deserializes an SCT from a TLS-encoded SCT.

func GeneralNamesToString

func GeneralNamesToString(gname *x509.GeneralNames) string

GeneralNamesToString creates a string description of an x509.GeneralNames object.

func MarshalSCTsIntoSCTList

func MarshalSCTsIntoSCTList(scts []*ct.SignedCertificateTimestamp) (*x509.SignedCertificateTimestampList, error)

MarshalSCTsIntoSCTList serializes SCTs into SCT list.

func NameToString

func NameToString(name pkix.Name) string

NameToString creates a string description of a pkix.Name object.

func OIDForStandardExtension

func OIDForStandardExtension(oid asn1.ObjectIdentifier) bool

OIDForStandardExtension indicates whether oid identifies a standard extension. Standard extensions are listed in RFC 5280 (and other RFCs).

func OIDInExtensions

func OIDInExtensions(oid asn1.ObjectIdentifier, extensions []pkix.Extension) (int, bool)

OIDInExtensions checks whether the extension identified by oid is present in extensions and returns how many times it occurs together with an indication of whether any of them are marked critical.

func OtherNameToString

func OtherNameToString(other x509.OtherName) string

OtherNameToString creates a string description of an x509.OtherName object.

func ParseSCTsFromCertificate

func ParseSCTsFromCertificate(certBytes []byte) ([]*ct.SignedCertificateTimestamp, error)

ParseSCTsFromCertificate parses any SCTs that are embedded in the certificate provided. The certificate bytes provided can be either DER or PEM, provided the PEM data starts with the PEM block marker (i.e. has no leading text).

func ParseSCTsFromSCTList

func ParseSCTsFromSCTList(sctList *x509.SignedCertificateTimestampList) ([]*ct.SignedCertificateTimestamp, error)

ParseSCTsFromSCTList parses each of the SCTs contained within an SCT list.

Types

This section is empty.

Jump to

Keyboard shortcuts

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