-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: William Woodruff <[email protected]>
- Loading branch information
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// This file is dual licensed under the terms of the Apache License, Version | ||
// 2.0, and the BSD License. See the LICENSE file in the root of this repository | ||
// for complete details. | ||
|
||
/// Extensional traits and functionality for certificates. | ||
use cryptography_x509::{certificate::Certificate, extensions::Extensions}; | ||
|
||
pub(crate) trait CertificateExt: private::Sealed { | ||
fn extensions<'a>(&'a self) -> Result<Option<Extensions<'a>>, asn1::ObjectIdentifier>; | ||
} | ||
|
||
impl CertificateExt for Certificate<'_> { | ||
fn extensions<'a>(&'a self) -> Result<Option<Extensions<'a>>, asn1::ObjectIdentifier> { | ||
self.tbs_cert.extensions() | ||
} | ||
} | ||
|
||
mod private { | ||
pub(crate) trait Sealed {} | ||
|
||
impl Sealed for cryptography_x509::certificate::Certificate<'_> {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
|
||
#![forbid(unsafe_code)] | ||
|
||
pub mod certificate; | ||
pub mod extensions; | ||
pub mod policy; | ||
pub mod trust_store; | ||
|