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:
- The
RSA_ID_X509certificate is provided in a CERTS cell, and used to transmit the RSA identity key. - 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Β§
- TlsKey
AndCert - A set of x.509 certificate information and keys for use with a TLS library.
EnumsΒ§
- X509
Cert Error - 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 forlifetime_daysadditionally. - 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.