pub struct Certificate {
pub name: Arc<Name>,
pub public_key: Bytes,
pub valid_from: u64,
pub valid_until: u64,
pub issuer: Option<Arc<Name>>,
pub signed_region: Option<Bytes>,
pub sig_value: Option<Bytes>,
}Expand description
A decoded NDN certificate (a signed Data packet with a public key payload).
Fields§
§name: Arc<Name>§public_key: Bytes§valid_from: u64§valid_until: u64§issuer: Option<Arc<Name>>The issuer’s key name (from SignatureInfo.KeyLocator).
Populated by Certificate::decode(); None for manually constructed certs.
signed_region: Option<Bytes>The signed region of the certificate Data (Name through end of SigInfo). Needed for chain-walking verification of this cert’s own signature.
sig_value: Option<Bytes>The signature value of the certificate Data.
Implementations§
Source§impl Certificate
impl Certificate
Sourcepub fn decode(data: &Data) -> Result<Self, TrustError>
pub fn decode(data: &Data) -> Result<Self, TrustError>
Decode a certificate from a Data packet.
The Content field is expected to contain:
- TLV type 0x00: raw public key bytes
- TLV type 0xFD (ValidityPeriod): nested tlv_type::NOT_BEFORE (0xFE) + tlv_type::NOT_AFTER (0xFF) as big-endian nanosecond timestamps
Sourcepub fn is_valid_at(&self, now_ns: u64) -> bool
pub fn is_valid_at(&self, now_ns: u64) -> bool
Returns true if the certificate is valid at the given time (nanoseconds
since Unix epoch).
Trait Implementations§
Source§impl Clone for Certificate
impl Clone for Certificate
Source§fn clone(&self) -> Certificate
fn clone(&self) -> Certificate
Returns a duplicate 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 moreAuto Trait Implementations§
impl !Freeze for Certificate
impl RefUnwindSafe for Certificate
impl Send for Certificate
impl Sync for Certificate
impl Unpin for Certificate
impl UnwindSafe for Certificate
Blanket Implementations§
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
Mutably borrows from an owned value. Read more