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
How many hours after the epoch will this certificate expire?
cert_type: CertType
Type of the certificate; recognized values are in certtype::*
cert_key: CertifiedKey
The key or object being certified.
extensions: Vec<CertExt>
A list of extensions.
signed_with: Option<Ed25519Identity>
The key that signed this cert.
Once the cert has been unwrapped from an KeyUnknownCert, this field will
be set. If there is a SignedWithEd25519
extension in
self.extensions
, this will match it.
Implementations§
Source§impl Ed25519Cert
impl Ed25519Cert
Sourcepub fn constructor() -> Ed25519CertConstructor
Available on crate feature encode
only.
pub fn constructor() -> Ed25519CertConstructor
encode
only.Return a new Ed25519CertConstructor
to create and return a new signed
Ed25519Cert
.
Source§impl Ed25519Cert
impl Ed25519Cert
Sourcepub fn decode(cert: &[u8]) -> BytesResult<KeyUnknownCert>
pub fn decode(cert: &[u8]) -> BytesResult<KeyUnknownCert>
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.
Sourcepub fn expiry(&self) -> SystemTime
pub fn expiry(&self) -> SystemTime
Return the time at which this certificate becomes expired
Sourcepub 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
.
Sourcepub fn subject_key(&self) -> &CertifiedKey
pub fn subject_key(&self) -> &CertifiedKey
Return the signed key or object that is authenticated by this certificate.
Sourcepub fn signing_key(&self) -> Option<&Ed25519Identity>
pub fn signing_key(&self) -> Option<&Ed25519Identity>
Return the ed25519 key that signed this certificate.
Trait Implementations§
Source§impl Clone for Ed25519Cert
impl Clone for Ed25519Cert
Source§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 moreSource§impl Debug for Ed25519Cert
impl Debug for Ed25519Cert
Source§impl Timebound<Ed25519Cert> for Ed25519Cert
impl Timebound<Ed25519Cert> for Ed25519Cert
Source§type Error = TimeValidityError
type Error = TimeValidityError
Source§fn is_valid_at(&self, t: &SystemTime) -> Result<(), Self::Error>
fn is_valid_at(&self, t: &SystemTime) -> Result<(), Self::Error>
Source§fn dangerously_assume_timely(self) -> Ed25519Cert
fn dangerously_assume_timely(self) -> Ed25519Cert
Source§fn check_valid_at(self, t: &SystemTime) -> Result<T, Self::Error>
fn check_valid_at(self, t: &SystemTime) -> Result<T, Self::Error>
Source§fn check_valid_now(self) -> Result<T, Self::Error>
fn check_valid_now(self) -> Result<T, Self::Error>
Source§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>
Source§impl Timebound<Ed25519Cert> for SigCheckedCert
impl Timebound<Ed25519Cert> for SigCheckedCert
Source§type Error = TimeValidityError
type Error = TimeValidityError
Source§fn is_valid_at(&self, t: &SystemTime) -> Result<(), Self::Error>
fn is_valid_at(&self, t: &SystemTime) -> Result<(), Self::Error>
Source§fn dangerously_assume_timely(self) -> Ed25519Cert
fn dangerously_assume_timely(self) -> Ed25519Cert
Source§fn check_valid_at(self, t: &SystemTime) -> Result<T, Self::Error>
fn check_valid_at(self, t: &SystemTime) -> Result<T, Self::Error>
Source§fn check_valid_now(self) -> Result<T, Self::Error>
fn check_valid_now(self) -> Result<T, Self::Error>
Source§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> 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