Skip to main content

Crate x509

Crate x509 

Source

Modules§

key_usage
Key usage bit positions

Structs§

X509Time
Parsed X.509 time (UTCTime or GeneralizedTime).

Enums§

Error

Constants§

OID_BASIC_CONSTRAINTS
2.5.29.19 – Basic Constraints
OID_ECDSA_SHA256
1.2.840.10045.4.3.2 – ecdsa-with-SHA256
OID_ECDSA_SHA384
1.2.840.10045.4.3.3 – ecdsa-with-SHA384
OID_EC_PUBLIC_KEY
OID_EC_PUBLIC_KEY_ALG
1.2.840.10045.2.1 – ecPublicKey (algorithm OID in SPKI)
OID_ED25519
1.3.101.112 – id-Ed25519
OID_EKU
2.5.29.37 – Extended Key Usage
OID_EKU_SERVER_AUTH
1.3.6.1.5.5.7.3.1 – serverAuth EKU
OID_KEY_USAGE
2.5.29.15 – Key Usage
OID_RSA_PSS
1.2.840.113549.1.1.10 – id-RSASSA-PSS
OID_RSA_SHA256
1.2.840.113549.1.1.11 – sha256WithRSAEncryption
OID_RSA_SHA384
1.2.840.113549.1.1.12 – sha384WithRSAEncryption
OID_RSA_SHA512
1.2.840.113549.1.1.13 – sha512WithRSAEncryption
OID_SAN
2.5.29.17 – Subject Alternative Name

Functions§

check_san_dns_name
Check whether any SAN dNSName matches the given server name, without allocating.
debug_dn_pairs
Debug helper: format a DN as a string of “OID=value” pairs.
dn_equal
Compare two Distinguished Name byte slices for equality, normalising the SET/SET-OF structure.
extract_issuer_dn
Extract the raw DER-encoded issuer Distinguished Name from an X.509 certificate.
extract_key_from_spki
Extract raw public key bytes from a SubjectPublicKeyInfo DER blob.
extract_public_key_from_cert
Extract raw public key bytes from an X.509 certificate (DER-encoded).
extract_signature_algorithm_oid
Extract the signature algorithm OID from an X.509 certificate.
extract_signature_value
Extract the signature value from a DER-encoded X.509 certificate.
extract_spki_algorithm_oid
Extract the algorithm OID from a SubjectPublicKeyInfo DER blob.
extract_spki_from_cert
Extract the SubjectPublicKeyInfo DER from an X.509 certificate.
extract_subject_dn
Extract the raw DER-encoded subject Distinguished Name from an X.509 certificate.
extract_tbs_cert
Extract the raw TBSCertificate bytes (tag + length + value) from a DER-encoded X.509 certificate.
find_extension
Find the value of an extension by OID.
has_eku_server_auth
Check whether the Extended Key Usage extension includes serverAuth (1.3.6.1.5.5.7.3.1).
is_ca
Check whether the certificate is a CA via the Basic Constraints extension.
parse_key_usage
Parse the Key Usage extension and return the raw bit mask as a u16.
parse_san_dns_names
Parse DNS names from the Subject Alternative Name extension.
parse_validity
Parse the validity period from an X.509 certificate.