• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2015 Brian Smith.
2 //
3 // Permission to use, copy, modify, and/or distribute this software for any
4 // purpose with or without fee is hereby granted, provided that the above
5 // copyright notice and this permission notice appear in all copies.
6 //
7 // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
8 // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9 // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
10 // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11 // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12 // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
13 // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14 
15 //! webpki: Web PKI X.509 Certificate Validation.
16 //!
17 //! See `EndEntityCert`'s documentation for a description of the certificate
18 //! processing steps necessary for a TLS connection.
19 //!
20 //! # Features
21 //!
22 //! | Feature | Description |
23 //! | ------- | ----------- |
24 //! | `alloc` | Enable features that require use of the heap. Currently all RSA signature algorithms require this feature. |
25 //! | `std` | Enable features that require libstd. Implies `alloc`. |
26 
27 #![doc(html_root_url = "https://briansmith.org/rustdoc/")]
28 #![cfg_attr(not(feature = "std"), no_std)]
29 #![allow(
30     clippy::doc_markdown,
31     clippy::if_not_else,
32     clippy::inline_always,
33     clippy::items_after_statements,
34     clippy::missing_errors_doc,
35     clippy::module_name_repetitions,
36     clippy::single_match,
37     clippy::single_match_else
38 )]
39 #![deny(clippy::as_conversions)]
40 
41 #[cfg(any(test, feature = "alloc"))]
42 #[cfg_attr(test, macro_use)]
43 extern crate alloc;
44 
45 #[macro_use]
46 mod der;
47 
48 mod calendar;
49 mod cert;
50 mod end_entity;
51 mod error;
52 mod name;
53 mod signed_data;
54 mod time;
55 mod trust_anchor;
56 
57 mod verify_cert;
58 
59 pub use {
60     end_entity::EndEntityCert,
61     error::Error,
62     name::{DnsNameRef, InvalidDnsNameError},
63     signed_data::{
64         SignatureAlgorithm, ECDSA_P256_SHA256, ECDSA_P256_SHA384, ECDSA_P384_SHA256,
65         ECDSA_P384_SHA384, ED25519,
66     },
67     time::Time,
68     trust_anchor::{TlsClientTrustAnchors, TlsServerTrustAnchors, TrustAnchor},
69 };
70 
71 #[cfg(feature = "alloc")]
72 pub use {
73     name::DnsName,
74     signed_data::{
75         RSA_PKCS1_2048_8192_SHA256, RSA_PKCS1_2048_8192_SHA384, RSA_PKCS1_2048_8192_SHA512,
76         RSA_PKCS1_3072_8192_SHA384, RSA_PSS_2048_8192_SHA256_LEGACY_KEY,
77         RSA_PSS_2048_8192_SHA384_LEGACY_KEY, RSA_PSS_2048_8192_SHA512_LEGACY_KEY,
78     },
79 };
80 
81 #[cfg(feature = "alloc")]
82 #[allow(unknown_lints, clippy::upper_case_acronyms)]
83 #[deprecated(note = "Use DnsName")]
84 pub type DNSName = DnsName;
85 
86 #[deprecated(note = "use DnsNameRef")]
87 #[allow(unknown_lints, clippy::upper_case_acronyms)]
88 pub type DNSNameRef<'a> = DnsNameRef<'a>;
89 
90 #[deprecated(note = "use TlsServerTrustAnchors")]
91 #[allow(unknown_lints, clippy::upper_case_acronyms)]
92 pub type TLSServerTrustAnchors<'a> = TlsServerTrustAnchors<'a>;
93 
94 #[deprecated(note = "use TlsClientTrustAnchors")]
95 #[allow(unknown_lints, clippy::upper_case_acronyms)]
96 pub type TLSClientTrustAnchors<'a> = TlsClientTrustAnchors<'a>;
97