Struct trust_graph::Trust [−][src]
One element in chain of trust in a certificate. TODO delete pk from Trust (it is already in a trust node)
Fields
issued_for: PublicKey
For whom this certificate is issued
expires_at: Duration
Expiration date of a trust.
signature: Signature
Signature of a previous trust in a chain. Signature is self-signed if it is a root trust.
issued_at: Duration
Creation time of a trust
Implementations
impl Trust
[src]
pub fn new(
issued_for: PublicKey,
expires_at: Duration,
issued_at: Duration,
signature: Signature
) -> Self
[src]
issued_for: PublicKey,
expires_at: Duration,
issued_at: Duration,
signature: Signature
) -> Self
pub fn create(
issued_by: &KeyPair,
issued_for: PublicKey,
expires_at: Duration,
issued_at: Duration
) -> Self
[src]
issued_by: &KeyPair,
issued_for: PublicKey,
expires_at: Duration,
issued_at: Duration
) -> Self
pub fn verify(
trust: &Trust,
issued_by: &PublicKey,
cur_time: Duration
) -> Result<(), TrustError>
[src]
trust: &Trust,
issued_by: &PublicKey,
cur_time: Duration
) -> Result<(), TrustError>
Verifies that authorization is cryptographically correct.
pub fn encode(&self) -> Vec<u8>
[src]
Encode the trust into a byte array
pub fn decode(arr: &[u8]) -> Result<Self, TrustError>
[src]
Decode a trust from a byte array as produced by encode
.
pub fn convert_from_strings(
issued_for: &str,
signature: &str,
expires_at: &str,
issued_at: &str
) -> Result<Self, TrustError>
[src]
issued_for: &str,
signature: &str,
expires_at: &str,
issued_at: &str
) -> Result<Self, TrustError>
Trait Implementations
impl Clone for Trust
[src]
impl Debug for Trust
[src]
impl<'de> Deserialize<'de> for Trust
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for Trust
[src]
impl PartialEq<Trust> for Trust
[src]
impl Serialize for Trust
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for Trust
[src]
impl StructuralPartialEq for Trust
[src]
impl ToString for Trust
[src]
Auto Trait Implementations
impl RefUnwindSafe for Trust
impl Send for Trust
impl Sync for Trust
impl Unpin for Trust
impl UnwindSafe for Trust
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,