pub struct KeyFrag { /* private fields */ }Expand description
A fragment of the encrypting party’s key used to create a CapsuleFrag.
Implementations§
Source§impl KeyFrag
impl KeyFrag
Sourcepub fn verify(
self,
verifying_pk: &PublicKey,
maybe_delegating_pk: Option<&PublicKey>,
maybe_receiving_pk: Option<&PublicKey>,
) -> Result<VerifiedKeyFrag, (KeyFragVerificationError, Self)>
pub fn verify( self, verifying_pk: &PublicKey, maybe_delegating_pk: Option<&PublicKey>, maybe_receiving_pk: Option<&PublicKey>, ) -> Result<VerifiedKeyFrag, (KeyFragVerificationError, Self)>
Verifies the integrity of the key fragment, given the signing key, and (optionally) the encrypting party’s and decrypting party’s keys.
If generate_kfrags() was called with true
for sign_delegating_key or sign_receiving_key, and the respective key
is not provided, the verification fails.
Sourcepub fn skip_verification(self) -> VerifiedKeyFrag
pub fn skip_verification(self) -> VerifiedKeyFrag
Explicitly skips KeyFrag::verify call.
Useful in cases when the verifying keys are impossible to obtain independently,
or when this capsule frag came from a trusted storage.
Warning: make sure you considered the implications of not enforcing verification.
Trait Implementations§
Source§impl<'de> DefaultDeserialize<'de> for KeyFrag
Available on crate feature default-serialization only.
impl<'de> DefaultDeserialize<'de> for KeyFrag
Available on crate feature
default-serialization only.Source§impl DefaultSerialize for KeyFrag
Available on crate feature default-serialization only.
impl DefaultSerialize for KeyFrag
Available on crate feature
default-serialization only.Source§impl<'de> Deserialize<'de> for KeyFrag
impl<'de> Deserialize<'de> for KeyFrag
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for KeyFrag
Auto Trait Implementations§
impl Freeze for KeyFrag
impl RefUnwindSafe for KeyFrag
impl Send for KeyFrag
impl Sync for KeyFrag
impl Unpin for KeyFrag
impl UnwindSafe for KeyFrag
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