pub struct DataIntegrity<T, S: CryptographicSuite> {
pub claims: T,
pub proofs: Proofs<S>,
}Expand description
Data-Integrity-secured document.
Fields§
§claims: T§proofs: Proofs<S>Implementations§
Source§impl<T, S: CryptographicSuite> DataIntegrity<T, S>
impl<T, S: CryptographicSuite> DataIntegrity<T, S>
Sourcepub fn new(claims: T, proofs: Proofs<S>) -> Self
pub fn new(claims: T, proofs: Proofs<S>) -> Self
Create new Data-Integrity-secured claims by providing the proofs.
Sourcepub async fn verify<P>(
&self,
params: P,
) -> Result<Verification, ProofValidationError>
pub async fn verify<P>( &self, params: P, ) -> Result<Verification, ProofValidationError>
Verify the claims and proofs.
The params argument provides all the verification parameters required
to validate the claims and proof.
§What verification parameters should I use?
It really depends on the claims type T and cryptosuite type S,
but the ssi::claims::VerificationParameters type is a good starting
point that should work most of the time.
§Passing the parameters by reference
If the validation traits are implemented for P, they will be
implemented for &P as well. This means the parameters can be passed
by move or by reference.
Sourcepub async fn select<P>(
&self,
params: P,
options: S::SelectionOptions,
) -> Result<DataIntegrity<Object, S>, SelectionError>where
S: CryptographicSuiteSelect<T, P>,
pub async fn select<P>(
&self,
params: P,
options: S::SelectionOptions,
) -> Result<DataIntegrity<Object, S>, SelectionError>where
S: CryptographicSuiteSelect<T, P>,
Select a subset of claims to disclose.
The params argument is similar to the verification parameters of the
verify function. It must provides resources necessary to the selection
of claims. This depends on the cryptosuite type S, but probably
includes a verification method resolver.
Using ssi::claims::VerificationParameters will work in most cases.
pub fn map<U>(self, f: impl FnOnce(T) -> U) -> DataIntegrity<U, S>
Trait Implementations§
Source§impl<T, S> Clone for DataIntegrity<T, S>
impl<T, S> Clone for DataIntegrity<T, S>
Source§impl<T, S> Debug for DataIntegrity<T, S>
impl<T, S> Debug for DataIntegrity<T, S>
Source§impl<T, S: CryptographicSuite> Deref for DataIntegrity<T, S>
impl<T, S: CryptographicSuite> Deref for DataIntegrity<T, S>
Source§impl<T, S: CryptographicSuite> DerefMut for DataIntegrity<T, S>
impl<T, S: CryptographicSuite> DerefMut for DataIntegrity<T, S>
Source§impl<'de, T, S> Deserialize<'de> for DataIntegrity<T, S>where
T: Deserialize<'de>,
S: DeserializeCryptographicSuite<'de>,
impl<'de, T, S> Deserialize<'de> for DataIntegrity<T, S>where
T: Deserialize<'de>,
S: DeserializeCryptographicSuite<'de>,
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>,
Source§impl<T, S> Serialize for DataIntegrity<T, S>
impl<T, S> Serialize for DataIntegrity<T, S>
Source§impl<T, S: CryptographicSuite> VerifiableClaims for DataIntegrity<T, S>
impl<T, S: CryptographicSuite> VerifiableClaims for DataIntegrity<T, S>
Auto Trait Implementations§
impl<T, S> Freeze for DataIntegrity<T, S>where
T: Freeze,
impl<T, S> RefUnwindSafe for DataIntegrity<T, S>where
T: RefUnwindSafe,
S: RefUnwindSafe,
<S as CryptographicSuite>::ProofOptions: RefUnwindSafe,
<S as CryptographicSuite>::Signature: RefUnwindSafe,
<S as CryptographicSuite>::VerificationMethod: RefUnwindSafe,
impl<T, S> Send for DataIntegrity<T, S>where
T: Send,
S: Send,
<S as CryptographicSuite>::ProofOptions: Send,
<S as CryptographicSuite>::Signature: Send,
<S as CryptographicSuite>::VerificationMethod: Send,
impl<T, S> Sync for DataIntegrity<T, S>where
T: Sync,
S: Sync,
<S as CryptographicSuite>::ProofOptions: Sync,
<S as CryptographicSuite>::Signature: Sync,
<S as CryptographicSuite>::VerificationMethod: Sync,
impl<T, S> Unpin for DataIntegrity<T, S>where
T: Unpin,
S: Unpin,
<S as CryptographicSuite>::ProofOptions: Unpin,
<S as CryptographicSuite>::Signature: Unpin,
<S as CryptographicSuite>::VerificationMethod: Unpin,
impl<T, S> UnwindSafe for DataIntegrity<T, S>where
T: UnwindSafe,
S: UnwindSafe,
<S as CryptographicSuite>::ProofOptions: UnwindSafe,
<S as CryptographicSuite>::Signature: UnwindSafe,
<S as CryptographicSuite>::VerificationMethod: UnwindSafe,
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
Source§impl<T> BorrowUnordered for T
impl<T> BorrowUnordered for T
fn as_unordered(&self) -> &Unordered<T>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'de, T, C> DeserializeTyped<'de, C> for Twhere
T: Deserialize<'de>,
impl<'de, T, C> DeserializeTyped<'de, C> for Twhere
T: Deserialize<'de>,
fn deserialize_typed<S>(
_: &C,
deserializer: S,
) -> Result<T, <S as Deserializer<'de>>::Error>where
S: Deserializer<'de>,
Source§impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
Source§impl<T> ResourceProvider<()> for T
impl<T> ResourceProvider<()> for T
Source§fn get_resource(&self) -> &()
fn get_resource(&self) -> &()
T.