-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
x509-cert: rework the profile of builder
This is now providing a trait to be implemented by the consumer. A number of implementation are available, including ones trying to abide by CABF Baseline Requirements. Fixes #1281
- Loading branch information
Showing
5 changed files
with
545 additions
and
217 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
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,39 @@ | ||
|
||
|
||
|
||
|
||
|
||
pub mod cabf; | ||
//pub mod piv; | ||
|
||
pub(crate) mod sealed { | ||
use alloc::vec; | ||
use spki::{ | ||
SubjectPublicKeyInfoRef, | ||
}; | ||
|
||
use crate::{ | ||
builder::Result, | ||
certificate::{TbsCertificate}, | ||
ext::{ | ||
Extension, | ||
}, | ||
name::Name, | ||
}; | ||
|
||
pub trait Profile { | ||
fn get_issuer(&self, subject: &Name) -> Name; | ||
|
||
fn get_subject(&self) -> Name; | ||
|
||
fn build_extensions( | ||
&self, | ||
spk: SubjectPublicKeyInfoRef<'_>, | ||
issuer_spk: SubjectPublicKeyInfoRef<'_>, | ||
tbs: &TbsCertificate, | ||
) -> Result<vec::Vec<Extension>>; | ||
} | ||
} | ||
|
||
#[cfg(feature = "hazmat")] | ||
pub use sealed::Profile; |
Oops, something went wrong.