Struct hdk::prelude::capability::CapSecret[][src]

pub struct CapSecret(_);

A CapSecret is used by a caller to prove to a callee access to a committed CapGrant.

It is a random, unique identifier for the capability, which is shared by the grantor to allow access to others. The grantor can optionally further restrict usage of the secret to specific agents.

@todo enforce that secrets are unique across all grants in a chain.

Trait Implementations

impl AsRef<[u8]> for CapSecret[src]

impl Clone for CapSecret[src]

impl Copy for CapSecret[src]

impl Debug for CapSecret[src]

The only meaningful debug information for a cryptograhpic secret is the literal bytes. Also, encodings like base64 are not constant time so debugging could open some weird side channel issue trying to be ‘human friendly’. It seems better to never try to encode secrets.

@todo maybe we want something like HIDDEN by default and putting the actual bytes behind a feature flag?

See https://docs.rs/subtle-encoding/0.5.1/subtle_encoding/

impl<'de> Deserialize<'de> for CapSecret[src]

impl Eq for CapSecret[src]

impl From<[u8; 64]> for CapSecret[src]

Trivial new type derivation. Secrets should have private interiors and be constructed directly from fixed length arrays of known length.

impl From<CapSecret> for CapAccess[src]

Implements secret.into() shorthand for CapAccess::Transferable(secret)

impl PartialEq<CapSecret> for CapSecret[src]

Constant time equality check. This mitigates timing attacks where a remote agent can reverse engineer data by measuring tiny changes in latency associated with optimised equality checks. More matching bytes = more latency = vulnerability. This type of attack has been successfully demonstrated over a network despite varied latencies.

impl Serialize for CapSecret[src]

impl<'_> TryFrom<&'_ [u8]> for CapSecret[src]

type Error = SecurePrimitiveError

The type returned in the event of a conversion error.

impl<'_> TryFrom<&'_ CapSecret> for SerializedBytes[src]

type Error = SerializedBytesError

The type returned in the event of a conversion error.

impl TryFrom<CapSecret> for SerializedBytes[src]

type Error = SerializedBytesError

The type returned in the event of a conversion error.

impl TryFrom<SerializedBytes> for CapSecret[src]

type Error = SerializedBytesError

The type returned in the event of a conversion error.

impl TryFromRandom for CapSecret[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,