Skip to content

Commit 1770e0c

Browse files
committed
verification: Rustdoc comments for Verifier.
This commit adds some missing Rustdoc comments for the various per-platform `Verifier` structs and associated methods. Doing so will avoid errors from missing comments once the types are part of the public API.
1 parent b6d612b commit 1770e0c

File tree

4 files changed

+7
-0
lines changed

4 files changed

+7
-0
lines changed

src/verification/android.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ enum VerifierStatus {
3434
// official recommendation. See https://bugs.chromium.org/p/chromium/issues/detail?id=627154.
3535
const AUTH_TYPE: &str = "RSA";
3636

37+
/// A TLS certificate verifier that utilizes the Android platform verifier.
3738
#[derive(Default)]
3839
pub struct Verifier {
3940
/// Testing only: The root CA certificate to trust.
@@ -55,13 +56,16 @@ impl Drop for Verifier {
5556
}
5657

5758
impl Verifier {
59+
/// Creates a new instance of a TLS certificate verifier that utilizes the
60+
/// Android certificate facilities
5861
pub fn new() -> Self {
5962
Self {
6063
#[cfg(any(test, feature = "ffi-testing"))]
6164
test_only_root_ca_override: None,
6265
}
6366
}
6467

68+
/// Creates a test-only TLS certificate verifier which trusts our fake root CA cert.
6569
#[cfg(any(test, feature = "ffi-testing"))]
6670
pub(crate) fn new_with_fake_root(root: &[u8]) -> Self {
6771
Self {

src/verification/apple.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ fn system_time_to_cfdate(time: SystemTime) -> Result<CFDate, TlsError> {
3737
.map(|epoch| CFDate::new(epoch.as_secs() as f64))
3838
}
3939

40+
/// A TLS certificate verifier that utilizes the Apple platform certificate facilities.
4041
#[derive(Default)]
4142
pub struct Verifier {
4243
/// Testing only: The root CA certificate to trust.

src/verification/others.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use rustls::{
55
CertificateError, Error as TlsError, RootCertStore,
66
};
77

8+
/// A TLS certificate verifier that uses the system's root store and WebPKI.
89
#[derive(Default)]
910
pub struct Verifier {
1011
// We use a `OnceCell` so we only need

src/verification/windows.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,7 @@ fn map_trust_error_status(unfiltered_status: DWORD) -> Result<(), TlsError> {
487487
)))
488488
}
489489

490+
/// A TLS certificate verifier that utilizes the Windows certificate facilities.
490491
#[derive(Default)]
491492
pub struct Verifier {
492493
/// Testing only: The root CA certificate to trust.

0 commit comments

Comments
 (0)