rocket/mtls/
mod.rs

1//! Support for mutual TLS client certificates.
2//!
3//! For details on how to configure mutual TLS, see [`MtlsConfig`] and the [TLS
4//! guide](https://rocket.rs/master/guide/configuration/#tls). See
5//! [`Certificate`] for a request guard that validates, verifies, and retrieves
6//! client certificates.
7
8pub mod oid {
9    //! Lower-level OID types re-exported from
10    //! [`oid_registry`](https://docs.rs/oid-registry/0.4) and
11    //! [`der-parser`](https://docs.rs/der-parser/7).
12
13    pub use x509_parser::oid_registry::*;
14    pub use x509_parser::objects::*;
15}
16
17pub mod bigint {
18    //! Signed and unsigned big integer types re-exported from
19    //! [`num_bigint`](https://docs.rs/num-bigint/0.4).
20    pub use x509_parser::der_parser::num_bigint::*;
21}
22
23pub mod x509 {
24    //! Lower-level X.509 types re-exported from
25    //! [`x509_parser`](https://docs.rs/x509-parser/0.13).
26    //!
27    //! Lack of documentation is directly inherited from the source crate.
28    //! Prefer to use Rocket's wrappers when possible.
29
30    pub use x509_parser::prelude::*;
31}
32
33mod certificate;
34mod error;
35mod name;
36mod config;
37
38pub use error::Error;
39pub use name::Name;
40pub use config::MtlsConfig;
41pub use certificate::{Certificate, CertificateDer};
42
43/// A type alias for `Result` with the error type set to [`Error`].
44pub type Result<T, E = Error> = std::result::Result<T, E>;