pub struct SignedCapability {
pub capability: Capability,
pub issuer_signature: Vec<u8>,
}Expand description
A capability plus the issuer’s signature over its canonical bytes.
Fields§
§capability: Capability§issuer_signature: Vec<u8>DER ECDSA signature by the issuer over capability.canonical_bytes().
Implementations§
Source§impl SignedCapability
impl SignedCapability
Sourcepub fn sign(
capability: Capability,
issuer: &Identity,
) -> Result<SignedCapability, AccessError>
pub fn sign( capability: Capability, issuer: &Identity, ) -> Result<SignedCapability, AccessError>
Sign capability with issuer. The capability’s issuer field should be
issuer.did(); if it isn’t, verification will fail (the directory key for
the claimed issuer won’t match this signature).
Sourcepub fn encode(&self) -> Result<Vec<u8>, AccessError>
pub fn encode(&self) -> Result<Vec<u8>, AccessError>
Serialize for transmission/persistence (postcard).
Sourcepub fn decode(bytes: &[u8]) -> Result<SignedCapability, AccessError>
pub fn decode(bytes: &[u8]) -> Result<SignedCapability, AccessError>
Deserialize a signed capability (postcard).
Trait Implementations§
Source§impl Clone for SignedCapability
impl Clone for SignedCapability
Source§fn clone(&self) -> SignedCapability
fn clone(&self) -> SignedCapability
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 SignedCapability
impl Debug for SignedCapability
Source§impl<'de> Deserialize<'de> for SignedCapability
impl<'de> Deserialize<'de> for SignedCapability
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SignedCapability, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SignedCapability, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for SignedCapability
Source§impl PartialEq for SignedCapability
impl PartialEq for SignedCapability
Source§impl Serialize for SignedCapability
impl Serialize for SignedCapability
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for SignedCapability
Auto Trait Implementations§
impl Freeze for SignedCapability
impl RefUnwindSafe for SignedCapability
impl Send for SignedCapability
impl Sync for SignedCapability
impl Unpin for SignedCapability
impl UnsafeUnpin for SignedCapability
impl UnwindSafe for SignedCapability
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