Skip to main content

structured_pkix/
lib.rs

1//! Certificates, read into a model that keeps what a decision needs.
2//!
3//! A certificate is read once and kept as it arrived: every field borrows the
4//! document, and the bytes a signature is computed over are handed back as the
5//! range they occupy rather than re-encoded from what was understood. A parser
6//! that re-encodes has decided that its own understanding is the document, and
7//! a signature checked over that says nothing about the file somebody was sent.
8//!
9//! Two kinds of fault are kept apart, because they lead to different answers.
10//!
11//! What cannot be represented honestly is refused: an unreadable encoding, a
12//! field the certificate's own version says is not there, two copies of one
13//! extension with no way to say which applies, or an algorithm named outside
14//! the signed bytes that differs from the one named inside them.
15//!
16//! What can be represented is reported rather than refused, even when it is
17//! wrong: a negative serial number, a validity interval that ends before it
18//! starts, a critical extension nobody here knows. Refusing those would leave
19//! the product unable to explain a document a person is holding, and
20//! explaining is the product.
21
22#![cfg_attr(not(feature = "std"), no_std)]
23
24extern crate alloc;
25
26#[cfg(test)]
27mod fixtures;
28
29#[cfg(test)]
30mod revocation_tests;
31
32pub mod access;
33pub mod algorithm;
34pub mod certificate;
35pub mod constraints;
36pub mod crl;
37pub mod der;
38pub mod error;
39pub mod extension;
40pub mod general_name;
41pub mod identifier;
42pub mod key;
43pub mod name;
44pub mod ocsp;
45pub mod oid;
46pub mod path;
47pub mod policy;
48pub mod qualified;
49pub mod temporal;
50pub mod time;
51pub mod usage;
52
53pub use algorithm::AlgorithmIdentifier;
54pub use certificate::{Certificate, TbsCertificate, Validity, Version};
55pub use error::{Error, ErrorCode, Result};
56pub use extension::{Extension, Extensions, Recognizer};
57pub use key::PublicKeyInfo;
58pub use name::{Attribute, Name, Ordered};
59pub use time::Time;