1pub mod auth;
24pub mod cert;
25#[cfg(windows)]
26mod cng;
27mod crypto;
28pub mod digest;
29mod error;
30pub mod identity;
31pub mod key;
32pub mod peer;
33#[cfg(any(test, feature = "testgen"))]
34pub mod testgen;
35#[cfg(all(
36 feature = "testgen",
37 not(test),
38 not(any(windows, all(unix, feature = "openssl"), feature = "testgen-rcgen"))
39))]
40compile_error!("`testgen` requires Windows, `openssl` on Unix, or the `testgen-rcgen` feature");
41pub mod trust;
42
43pub use self::cert::{Certificate, KeyType, SanIp, SubjectAltNames, pem_encode};
44pub use self::error::Error;
45pub use self::identity::{ClientIdentity, Identity, IdentitySource};
46pub use self::key::{HashAlg, PrivateKey, SignScheme};
47pub use self::peer::PeerCerts;
48pub use self::trust::{CaCerts, TrustError};
49
50#[cfg(any(
51 target_arch = "x86_64",
52 all(target_arch = "aarch64", target_feature = "neon")
53))]
54static BASE64: std::sync::LazyLock<base64::engine::Simd> = std::sync::LazyLock::new(|| {
55 base64::engine::Simd::standard(base64::engine::general_purpose::PAD)
56});
57
58#[cfg(not(any(
59 target_arch = "x86_64",
60 all(target_arch = "aarch64", target_feature = "neon")
61)))]
62use base64::engine::general_purpose::STANDARD as BASE64;
63
64#[cfg(test)]
66pub(crate) fn test_provider() {
67 #[cfg(all(not(windows), feature = "rustls", not(feature = "rustls-ring")))]
68 let _ = tls_rustls::crypto::ring::default_provider().install_default();
69}