pub struct ProofConfiguration<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 extra_properties: BTreeMap<String, Value>,
}Expand description
Proof configuration.
Proof object without the signature value.
Fields§
§context: Option<Context>§type_: SProof type.
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.
extra_properties: BTreeMap<String, Value>Extra properties.
Implementations§
Source§impl<S: CryptographicSuite> ProofConfiguration<S>
impl<S: CryptographicSuite> ProofConfiguration<S>
pub fn new( type_: S, created: Lexical<DateTimeStamp>, verification_method: ReferenceOrOwned<S::VerificationMethod>, proof_purpose: ProofPurpose, options: S::ProofOptions, ) -> Self
pub fn from_method_and_options( type_: S, verification_method: ReferenceOrOwned<S::VerificationMethod>, options: S::ProofOptions, ) -> Self
pub fn from_method(
type_: S,
verification_method: ReferenceOrOwned<S::VerificationMethod>,
) -> Selfwhere
S::ProofOptions: Default,
pub fn into_suite_and_options( self, ) -> (S, ProofOptions<S::VerificationMethod, S::ProofOptions>)
pub fn into_options( self, ) -> ProofOptions<S::VerificationMethod, S::ProofOptions>
pub fn into_proof(self, signature: S::Signature) -> Proof<S>
pub fn map<T: CryptographicSuite>( self, map_type: impl FnOnce(S) -> T, map_verification_method: impl FnOnce(S::VerificationMethod) -> T::VerificationMethod, map_options: impl FnOnce(S::ProofOptions) -> T::ProofOptions, ) -> ProofConfiguration<T>
pub fn borrowed(&self) -> ProofConfigurationRef<'_, S>
Trait Implementations§
Source§impl<S: Clone + CryptographicSuite> Clone for ProofConfiguration<S>
impl<S: Clone + CryptographicSuite> Clone for ProofConfiguration<S>
Source§fn clone(&self) -> ProofConfiguration<S>
fn clone(&self) -> ProofConfiguration<S>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<S: Debug + CryptographicSuite> Debug for ProofConfiguration<S>
impl<S: Debug + CryptographicSuite> Debug for ProofConfiguration<S>
Source§impl<'de, T: DeserializeCryptographicSuite<'de>> Deserialize<'de> for ProofConfiguration<T>
impl<'de, T: DeserializeCryptographicSuite<'de>> Deserialize<'de> for ProofConfiguration<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> Serialize for ProofConfiguration<S>where
S: SerializeCryptographicSuite + CryptographicSuite,
impl<S> Serialize for ProofConfiguration<S>where
S: SerializeCryptographicSuite + CryptographicSuite,
Auto Trait Implementations§
impl<S> Freeze for ProofConfiguration<S>where
S: Freeze,
<S as CryptographicSuite>::ProofOptions: Freeze,
<S as CryptographicSuite>::VerificationMethod: Freeze,
impl<S> RefUnwindSafe for ProofConfiguration<S>where
S: RefUnwindSafe,
<S as CryptographicSuite>::ProofOptions: RefUnwindSafe,
<S as CryptographicSuite>::VerificationMethod: RefUnwindSafe,
impl<S> Send for ProofConfiguration<S>where
S: Send,
<S as CryptographicSuite>::ProofOptions: Send,
<S as CryptographicSuite>::VerificationMethod: Send,
impl<S> Sync for ProofConfiguration<S>where
S: Sync,
<S as CryptographicSuite>::ProofOptions: Sync,
<S as CryptographicSuite>::VerificationMethod: Sync,
impl<S> Unpin for ProofConfiguration<S>where
S: Unpin,
<S as CryptographicSuite>::ProofOptions: Unpin,
<S as CryptographicSuite>::VerificationMethod: Unpin,
impl<S> UnwindSafe for ProofConfiguration<S>where
S: UnwindSafe,
<S as CryptographicSuite>::ProofOptions: 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.