22use wasm_bindgen:: prelude:: * ;
33
44#[ cfg( not( target_family = "wasm" ) ) ]
5- use std :: time :: { Duration , SystemTime } ;
5+ use crate :: Timestamp ;
66
77/// Represents the parts of [WireIdentity][crate::WireIdentity] that are specific to a X509 certificate (and not a Basic one).
88///
@@ -39,7 +39,7 @@ pub struct X509Identity {
3939
4040 /// X509 certificate not before
4141 #[ cfg( not( target_family = "wasm" ) ) ]
42- pub not_before : SystemTime ,
42+ pub not_before : Timestamp ,
4343
4444 /// X509 certificate not after as Unix timestamp
4545 #[ cfg( target_family = "wasm" ) ]
@@ -48,7 +48,7 @@ pub struct X509Identity {
4848
4949 /// X509 certificate not after
5050 #[ cfg( not( target_family = "wasm" ) ) ]
51- pub not_after : SystemTime ,
51+ pub not_after : Timestamp ,
5252}
5353
5454impl From < core_crypto:: prelude:: X509Identity > for X509Identity {
@@ -60,10 +60,10 @@ impl From<core_crypto::prelude::X509Identity> for X509Identity {
6060 let not_after = i. not_after ;
6161
6262 #[ cfg( not( target_family = "wasm" ) ) ]
63- let not_before = SystemTime :: UNIX_EPOCH + Duration :: from_secs ( i. not_before ) ;
63+ let not_before = Timestamp :: from_epoch_secs ( i. not_before ) ;
6464
6565 #[ cfg( not( target_family = "wasm" ) ) ]
66- let not_after = SystemTime :: UNIX_EPOCH + Duration :: from_secs ( i. not_after ) ;
66+ let not_after = Timestamp :: from_epoch_secs ( i. not_after ) ;
6767
6868 Self {
6969 handle : i. handle ,
0 commit comments