Skip to main content

Crate tor_cert_x509

Crate tor_cert_x509 

Source
Expand description

Β§tor-cert

Code for generating x509 certificates.

Β§Overview

For the most part, Tor doesn’t actually need x509 certificates. We only keep them around for two purposes:

  1. The RSA_ID_X509 certificate is provided in a CERTS cell, and used to transmit the RSA identity key.
  2. TLS requires the responder to have an x509 certificate.

This crate is part of Arti, a project to implement Tor in Rust.

See also tor-cert and tor-netdoc::doc::authcert for other kinds of certificates implemented by Tor.

License: MIT OR Apache-2.0

Re-exportsΒ§

pub(crate) use rsa::pkcs8::EncodePrivateKey as _; πŸ”’
pub(crate) use rsa::pkcs8::SubjectPublicKeyInfo; πŸ”’
pub(crate) use sync::Arc; πŸ”’
pub(crate) use Duration; πŸ”’
pub(crate) use SystemTime; πŸ”’
pub(crate) use digest::Digest; πŸ”’
pub(crate) use rand::CryptoRng; πŸ”’
pub(crate) use SubjectPublicKeyInfo; πŸ”’
pub(crate) use tor_error::into_internal; πŸ”’
pub(crate) use pk::rsa::KeyPair as RsaKeypair; πŸ”’
pub(crate) use util::rng::RngCompat; πŸ”’
pub(crate) use Builder; πŸ”’
pub(crate) use CertificateBuilder; πŸ”’
pub(crate) use Profile; πŸ”’
pub(crate) use DateTime; πŸ”’
pub(crate) use Encode; πŸ”’
pub(crate) use asn1::GeneralizedTime; πŸ”’
pub(crate) use zeroize::Zeroizing; πŸ”’
pub(crate) use KeyUsage; πŸ”’
pub(crate) use KeyUsages; πŸ”’
pub(crate) use serial_number::SerialNumber; πŸ”’
pub(crate) use time::Validity; πŸ”’

StructsΒ§

TlsKeyAndCert
A set of x.509 certificate information and keys for use with a TLS library.

EnumsΒ§

X509CertError
An error that has occurred while trying to create a certificate.

ConstantsΒ§

EXPECT_ID_BITS πŸ”’
Legacy identity keys are required to have this length.
EXPECT_ID_EXPONENT πŸ”’
Legacy identity keys are required to have this exponent.
ID_CERT_LIFETIME_DAYS πŸ”’
Lifetime of generated id certs, in days.
TLS_CERT_LIFETIME_DAYS πŸ”’
What lifetime do we pick for a TLS certificate, in days?

FunctionsΒ§

cert_validity πŸ”’
Return a Validity that includes now, and lasts for lifetime_days additionally.
create_legacy_rsa_id_cert
Create an X.509 certificate, for use in a CERTS cell, self-certifying the provided RSA identity key.
random_serial_number πŸ”’
Return a random serial number for use in a new certificate.