go/src/crypto/x509/parser.go

// isPrintable reports whether the given b is in the ASN.1 PrintableString set.
// This is a simplified version of encoding/asn1.isPrintable.
func isPrintable(b byte) bool {}

// parseASN1String parses the ASN.1 string types T61String, PrintableString,
// UTF8String, BMPString, IA5String, and NumericString. This is mostly copied
// from the respective encoding/asn1.parse... methods, rather than just
// increasing the API surface of that package.
func parseASN1String(tag cryptobyte_asn1.Tag, value []byte) (string, error) {}

// parseName parses a DER encoded Name as defined in RFC 5280. We may
// want to export this function in the future for use in crypto/tls.
func parseName(raw cryptobyte.String) (*pkix.RDNSequence, error) {}

func parseAI(der cryptobyte.String) (pkix.AlgorithmIdentifier, error) {}

func parseTime(der *cryptobyte.String) (time.Time, error) {}

func parseValidity(der cryptobyte.String) (time.Time, time.Time, error) {}

func parseExtension(der cryptobyte.String) (pkix.Extension, error) {}

func parsePublicKey(keyData *publicKeyInfo) (any, error) {}

func parseKeyUsageExtension(der cryptobyte.String) (KeyUsage, error) {}

func parseBasicConstraintsExtension(der cryptobyte.String) (bool, int, error) {}

func forEachSAN(der cryptobyte.String, callback func(tag int, data []byte) error) error {}

func parseSANExtension(der cryptobyte.String) (dnsNames, emailAddresses []string, ipAddresses []net.IP, uris []*url.URL, err error) {}

func parseAuthorityKeyIdentifier(e pkix.Extension) ([]byte, error) {}

func parseExtKeyUsageExtension(der cryptobyte.String) ([]ExtKeyUsage, []asn1.ObjectIdentifier, error) {}

func parseCertificatePoliciesExtension(der cryptobyte.String) ([]OID, error) {}

// isValidIPMask reports whether mask consists of zero or more 1 bits, followed by zero bits.
func isValidIPMask(mask []byte) bool {}

func parseNameConstraintsExtension(out *Certificate, e pkix.Extension) (unhandled bool, err error) {}

func processExtensions(out *Certificate) error {}

var x509negativeserial

func parseCertificate(der []byte) (*Certificate, error) {}

// ParseCertificate parses a single certificate from the given ASN.1 DER data.
//
// Before Go 1.23, ParseCertificate accepted certificates with negative serial
// numbers. This behavior can be restored by including "x509negativeserial=1" in
// the GODEBUG environment variable.
func ParseCertificate(der []byte) (*Certificate, error) {}

// ParseCertificates parses one or more certificates from the given ASN.1 DER
// data. The certificates must be concatenated with no intermediate padding.
func ParseCertificates(der []byte) ([]*Certificate, error) {}

const x509v2Version

// ParseRevocationList parses a X509 v2 [Certificate] Revocation List from the given
// ASN.1 DER data.
func ParseRevocationList(der []byte) (*RevocationList, error) {}