Skip to content

Commit

Permalink
x509-cert: adds a Validity::new method
Browse files Browse the repository at this point in the history
  • Loading branch information
baloo committed Sep 25, 2024
1 parent d801da6 commit 663dd5c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions x509-cert/src/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,15 @@ impl<P> Validity<P>
where
P: Profile,
{
/// Creates a `Validity` with the provided bounds
pub const fn new(not_before: Time, not_after: Time) -> Self {
Self {
not_before,
not_after,
_profile: PhantomData,
}
}

/// Creates a `Validity` which starts now and lasts for `duration`.
#[cfg(feature = "std")]
pub fn from_now(duration: Duration) -> der::Result<Self> {
Expand Down

0 comments on commit 663dd5c

Please sign in to comment.