Struct Ed25519Cert
pub struct Ed25519Cert {
pub(crate) exp_hours: u32,
pub(crate) cert_type: CertType,
pub(crate) cert_key: CertifiedKey,
pub(crate) extensions: Vec<CertExt>,
pub(crate) signed_with: Option<Ed25519Identity>,
}
Expand description
Structure for an Ed25519-signed certificate as described in Tor’s cert-spec.txt.
Fields§
§exp_hours: u32
§cert_type: CertType
§cert_key: CertifiedKey
§extensions: Vec<CertExt>
§signed_with: Option<Ed25519Identity>
Implementations§
§impl Ed25519Cert
impl Ed25519Cert
pub fn constructor() -> Ed25519CertConstructor
pub fn constructor() -> Ed25519CertConstructor
Return a new Ed25519CertConstructor
to create and return a new signed
Ed25519Cert
.
§impl Ed25519Cert
impl Ed25519Cert
pub fn decode(cert: &[u8]) -> Result<KeyUnknownCert, Error>
pub fn decode(cert: &[u8]) -> Result<KeyUnknownCert, Error>
Try to decode a certificate from a byte slice.
This function returns an error if the byte slice is not completely exhausted.
Note that the resulting KeyUnknownCertificate is not checked for validity at all: you will need to provide it with an expected signing key, then check it for timeliness and well-signedness.
pub fn expiry(&self) -> SystemTime
pub fn expiry(&self) -> SystemTime
Return the time at which this certificate becomes expired
pub fn is_expired_at(&self, when: SystemTime) -> bool
pub fn is_expired_at(&self, when: SystemTime) -> bool
Return true iff this certificate will be expired at the time when
.
pub fn subject_key(&self) -> &CertifiedKey
pub fn subject_key(&self) -> &CertifiedKey
Return the signed key or object that is authenticated by this certificate.
pub fn signing_key(&self) -> Option<&Ed25519Identity>
pub fn signing_key(&self) -> Option<&Ed25519Identity>
Return the ed25519 key that signed this certificate.
pub fn cert_type(&self) -> CertType
pub fn cert_type(&self) -> CertType
Return the type of this certificate.
Trait Implementations§
Source§impl AsRef<Ed25519Cert> for ValidatedEd25519Cert
impl AsRef<Ed25519Cert> for ValidatedEd25519Cert
Source§fn as_ref(&self) -> &Ed25519Cert
fn as_ref(&self) -> &Ed25519Cert
§impl Clone for Ed25519Cert
impl Clone for Ed25519Cert
§fn clone(&self) -> Ed25519Cert
fn clone(&self) -> Ed25519Cert
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for Ed25519Cert
impl Debug for Ed25519Cert
§impl Timebound<Ed25519Cert> for Ed25519Cert
impl Timebound<Ed25519Cert> for Ed25519Cert
§fn is_valid_at(
&self,
t: &SystemTime,
) -> Result<(), <Ed25519Cert as Timebound<Ed25519Cert>>::Error>
fn is_valid_at( &self, t: &SystemTime, ) -> Result<(), <Ed25519Cert as Timebound<Ed25519Cert>>::Error>
§fn dangerously_assume_timely(self) -> Ed25519Cert
fn dangerously_assume_timely(self) -> Ed25519Cert
§fn check_valid_at(self, t: &SystemTime) -> Result<T, Self::Error>
fn check_valid_at(self, t: &SystemTime) -> Result<T, Self::Error>
§fn check_valid_now(self) -> Result<T, Self::Error>
fn check_valid_now(self) -> Result<T, Self::Error>
§fn check_valid_at_opt(self, t: Option<SystemTime>) -> Result<T, Self::Error>
fn check_valid_at_opt(self, t: Option<SystemTime>) -> Result<T, Self::Error>
Auto Trait Implementations§
impl Freeze for Ed25519Cert
impl RefUnwindSafe for Ed25519Cert
impl Send for Ed25519Cert
impl Sync for Ed25519Cert
impl Unpin for Ed25519Cert
impl UnwindSafe for Ed25519Cert
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which can then be further
downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more