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
sourceimpl Ed25519Cert
impl Ed25519Cert
sourcepub fn decode(cert: &[u8]) -> Result<KeyUnknownCert>
pub fn decode(cert: &[u8]) -> Result<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<&PublicKey>
pub fn signing_key(&self) -> Option<&PublicKey>
Return the ed25519 key that signed this certificate.
Trait Implementations
sourceimpl 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.
sourcefn 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
sourcefn dangerously_assume_timely(self) -> Ed25519Cert
fn dangerously_assume_timely(self) -> Ed25519Cert
Return the underlying object without checking whether it’s valid.
sourcefn 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.
sourcefn 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.
sourcefn 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. Read more
Auto Trait Implementations
impl RefUnwindSafe for Ed25519Cert
impl Send for Ed25519Cert
impl Sync for Ed25519Cert
impl Unpin for Ed25519Cert
impl UnwindSafe for Ed25519Cert
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more