pub struct Proof<S: CryptographicSuite> {
pub context: Option<Context>,
pub type_: S,
pub created: Option<Lexical<DateTimeStamp>>,
pub verification_method: ReferenceOrOwned<S::VerificationMethod>,
pub proof_purpose: ProofPurpose,
pub expires: Option<Lexical<DateTimeStamp>>,
pub domains: Vec<String>,
pub challenge: Option<String>,
pub nonce: Option<String>,
pub options: S::ProofOptions,
pub signature: S::Signature,
pub extra_properties: BTreeMap<String, Value>,
}Expand description
Data Integrity Proof.
A data integrity proof provides information about the proof mechanism, parameters required to verify that proof, and the proof value itself.
Fields§
§context: Option<Context>Proof context.
type_: SProof type.
Also includes the cryptographic suite variant.
created: Option<Lexical<DateTimeStamp>>Date a creation of the proof.
verification_method: ReferenceOrOwned<S::VerificationMethod>Verification method.
proof_purpose: ProofPurposePurpose of the proof.
expires: Option<Lexical<DateTimeStamp>>Specifies when the proof expires.
domains: Vec<String>Conveys one or more security domains in which the proof is meant to be used.
A verifier SHOULD use the value to ensure that the proof was intended to be used in the security domain in which the verifier is operating. The specification of the domain parameter is useful in challenge-response protocols where the verifier is operating from within a security domain known to the creator of the proof.
Example domain values include: domain.example`` (DNS domain), https://domain.example:8443(Web origin),mycorp-intranet(bespoke text string), andb31d37d4-dd59-47d3-9dd8-c973da43b63a` (UUID).
challenge: Option<String>Used to mitigate replay attacks.
Used once for a particular domain and window of time. Examples of a
challenge value include: 1235abcd6789,
79d34551-ae81-44ae-823b-6dadbab9ebd4, and ruby.
nonce: Option<String>Arbitrary string supplied by the proof creator.
One use of this field is to increase privacy by decreasing linkability that is the result of deterministically generated signatures.
options: S::ProofOptionsAdditional proof options required by the cryptographic suite.
For instance, tezos cryptosuites requires the public key associated with the verification method, which is a blockchain account id.
signature: S::SignatureProof signature.
extra_properties: BTreeMap<String, Value>Extra properties unrelated to the cryptographic suite.
Implementations§
Source§impl<T: CryptographicSuite> Proof<T>
impl<T: CryptographicSuite> Proof<T>
Sourcepub fn new(
type_: T,
created: Lexical<DateTimeStamp>,
verification_method: ReferenceOrOwned<T::VerificationMethod>,
proof_purpose: ProofPurpose,
options: T::ProofOptions,
signature: T::Signature,
) -> Self
pub fn new( type_: T, created: Lexical<DateTimeStamp>, verification_method: ReferenceOrOwned<T::VerificationMethod>, proof_purpose: ProofPurpose, options: T::ProofOptions, signature: T::Signature, ) -> Self
Creates a new proof.
pub fn borrowed(&self) -> ProofRef<'_, T>
pub fn with_context(self, context: Context) -> Self
pub fn suite(&self) -> &T
pub fn configuration(&self) -> ProofConfigurationRef<'_, T>
pub fn map_type<U: CryptographicSuite>( self, type_: impl FnOnce(T) -> U, verification_method: impl FnOnce(T::VerificationMethod) -> U::VerificationMethod, options: impl FnOnce(T::ProofOptions) -> U::ProofOptions, signature: impl FnOnce(T::Signature) -> U::Signature, ) -> Proof<U>
Trait Implementations§
Source§impl<T, S: CryptographicSuite> AttachProof<T> for Proof<S>
impl<T, S: CryptographicSuite> AttachProof<T> for Proof<S>
Source§impl<S: CloneCryptographicSuite> Clone for Proof<S>
impl<S: CloneCryptographicSuite> Clone for Proof<S>
Source§impl<S: DebugCryptographicSuite> Debug for Proof<S>
impl<S: DebugCryptographicSuite> Debug for Proof<S>
Source§impl<'de, T: DeserializeCryptographicSuite<'de>> Deserialize<'de> for Proof<T>
impl<'de, T: DeserializeCryptographicSuite<'de>> Deserialize<'de> for Proof<T>
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<S: CryptographicSuite> Extend<Proof<S>> for Proofs<S>
impl<S: CryptographicSuite> Extend<Proof<S>> for Proofs<S>
Source§fn extend<T: IntoIterator<Item = Proof<S>>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = Proof<S>>>(&mut self, iter: T)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)Source§impl<S: CryptographicSuite> FromIterator<Proof<S>> for Proofs<S>
impl<S: CryptographicSuite> FromIterator<Proof<S>> for Proofs<S>
Source§impl<S> Serialize for Proof<S>where
S: SerializeCryptographicSuite + CryptographicSuite,
impl<S> Serialize for Proof<S>where
S: SerializeCryptographicSuite + CryptographicSuite,
Source§impl<S, T, V> ValidateProof<V, T> for Proof<S>where
S: CryptographicSuiteVerification<T, V> + CryptographicSuite,
V: ResourceProvider<InputVerificationOptions<S>>,
impl<S, T, V> ValidateProof<V, T> for Proof<S>where
S: CryptographicSuiteVerification<T, V> + CryptographicSuite,
V: ResourceProvider<InputVerificationOptions<S>>,
Source§async fn validate_proof<'a>(
&'a self,
verifier: &'a V,
claims: &'a T,
) -> Result<ProofValidity, ProofValidationError>
async fn validate_proof<'a>( &'a self, verifier: &'a V, claims: &'a T, ) -> Result<ProofValidity, ProofValidationError>
Auto Trait Implementations§
impl<S> Freeze for Proof<S>where
S: Freeze,
<S as CryptographicSuite>::ProofOptions: Freeze,
<S as CryptographicSuite>::Signature: Freeze,
<S as CryptographicSuite>::VerificationMethod: Freeze,
impl<S> RefUnwindSafe for Proof<S>where
S: RefUnwindSafe,
<S as CryptographicSuite>::ProofOptions: RefUnwindSafe,
<S as CryptographicSuite>::Signature: RefUnwindSafe,
<S as CryptographicSuite>::VerificationMethod: RefUnwindSafe,
impl<S> Send for Proof<S>where
S: Send,
<S as CryptographicSuite>::ProofOptions: Send,
<S as CryptographicSuite>::Signature: Send,
<S as CryptographicSuite>::VerificationMethod: Send,
impl<S> Sync for Proof<S>where
S: Sync,
<S as CryptographicSuite>::ProofOptions: Sync,
<S as CryptographicSuite>::Signature: Sync,
<S as CryptographicSuite>::VerificationMethod: Sync,
impl<S> Unpin for Proof<S>where
S: Unpin,
<S as CryptographicSuite>::ProofOptions: Unpin,
<S as CryptographicSuite>::Signature: Unpin,
<S as CryptographicSuite>::VerificationMethod: Unpin,
impl<S> UnwindSafe for Proof<S>where
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.