Struct tor_cert::Ed25519Cert
source · pub struct Ed25519Cert { /* private fields */ }Expand description
Structure for an Ed25519-signed certificate as described in Tor’s cert-spec.txt.
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
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for Ed25519Cert
impl Debug for Ed25519Cert
source§impl Timebound<Ed25519Cert> for Ed25519Cert
impl Timebound<Ed25519Cert> for Ed25519Cert
§type Error = TimeValidityError
type Error = TimeValidityError
An error type that’s returned when the object is not timely.
source§fn is_valid_at(&self, t: &SystemTime) -> Result<(), Self::Error>
fn is_valid_at(&self, t: &SystemTime) -> Result<(), Self::Error>
Check whether this object is valid at a given time. Read more
source§fn dangerously_assume_timely(self) -> Ed25519Cert
fn dangerously_assume_timely(self) -> Ed25519Cert
Return the underlying object without checking whether it’s valid.
source§fn check_valid_at(self, t: &SystemTime) -> Result<T, Self::Error>
fn check_valid_at(self, t: &SystemTime) -> Result<T, Self::Error>
Unwrap this Timebound object if it is valid at a given time.
source§fn check_valid_now(self) -> Result<T, Self::Error>
fn check_valid_now(self) -> Result<T, Self::Error>
Unwrap this Timebound object if it is valid now.
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>
Unwrap this object if it is valid at the provided time t.
If no time is provided, check the object at the current time.
source§impl Timebound<Ed25519Cert> for SigCheckedCert
impl Timebound<Ed25519Cert> for SigCheckedCert
§type Error = TimeValidityError
type Error = TimeValidityError
An error type that’s returned when the object is not timely.
source§fn is_valid_at(&self, t: &SystemTime) -> Result<(), Self::Error>
fn is_valid_at(&self, t: &SystemTime) -> Result<(), Self::Error>
Check whether this object is valid at a given time. Read more
source§fn dangerously_assume_timely(self) -> Ed25519Cert
fn dangerously_assume_timely(self) -> Ed25519Cert
Return the underlying object without checking whether it’s valid.
source§fn check_valid_at(self, t: &SystemTime) -> Result<T, Self::Error>
fn check_valid_at(self, t: &SystemTime) -> Result<T, Self::Error>
Unwrap this Timebound object if it is valid at a given time.
source§fn check_valid_now(self) -> Result<T, Self::Error>
fn check_valid_now(self) -> Result<T, Self::Error>
Unwrap this Timebound object if it is valid now.
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>
Unwrap this object if it is valid at the provided time t.
If no time is provided, check the object at the current time.