Skip to content

Commit 514782c

Browse files
authored
x509-cert: adds a Validity::new method (#1529)
1 parent d801da6 commit 514782c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

x509-cert/src/time.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,15 @@ impl<P> Validity<P>
147147
where
148148
P: Profile,
149149
{
150+
/// Creates a `Validity` with the provided bounds
151+
pub const fn new(not_before: Time, not_after: Time) -> Self {
152+
Self {
153+
not_before,
154+
not_after,
155+
_profile: PhantomData,
156+
}
157+
}
158+
150159
/// Creates a `Validity` which starts now and lasts for `duration`.
151160
#[cfg(feature = "std")]
152161
pub fn from_now(duration: Duration) -> der::Result<Self> {

0 commit comments

Comments
 (0)