[][src]Struct vade_evan::VadeEvan

pub struct VadeEvan { /* fields omitted */ }

Implementations

impl VadeEvan[src]

pub fn new(vade: Vade, signer: Box<dyn Signer>) -> VadeEvan[src]

Creates new instance of VadeEvan.

impl VadeEvan[src]

pub fn generate_safe_prime() -> Result<String, Box<dyn Error>>[src]

Generate new safe prime number with ursa's configured default size. Can be used to generate values for:

  • payload.p_safe
  • payload.q_safe

for vc_zkp_create_credential_definition.

Trait Implementations

impl VadePlugin for VadeEvan[src]

fn run_custom_function<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
    &'life0 mut self,
    method: &'life1 str,
    function: &'life2 str,
    _options: &'life3 str,
    _payload: &'life4 str
) -> Pin<Box<dyn Future<Output = Result<VadePluginResultValue<Option<String>>, Box<dyn Error>>> + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
    'life4: 'async_trait,
    Self: 'async_trait, 
[src]

Runs a custom function, currently supports

Arguments

  • method - method to call a function for (e.g. "did:example")
  • function - currently only supports generate_safe_prime
  • _options - currently not used, so can be left empty
  • _payload - currently not used, so can be left empty

fn vc_zkp_create_credential_definition<'life0, 'life1, 'life2, 'life3, 'async_trait>(
    &'life0 mut self,
    method: &'life1 str,
    options: &'life2 str,
    payload: &'life3 str
) -> Pin<Box<dyn Future<Output = Result<VadePluginResultValue<Option<String>>, Box<dyn Error>>> + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
    Self: 'async_trait, 
[src]

Creates a new credential definition and stores the public part on-chain. The private part (key) needs to be stored in a safe way and must not be shared. A credential definition holds cryptographic material needed to verify proofs. Every definition is bound to one credential schema.

To improve performance, safe prime numbers that are used to derive keys from can be pre-generated with custom function generate_safe_prime which can be called with run_custom_function. For these numbers two calls have to be made to create two distinct numbers. They can then be provided as payload.p_safe and payload.q_safe.

Note that options.identity needs to be whitelisted for this function.

Arguments

Returns

  • Option<String> - The created definition as a JSON object

fn vc_zkp_create_credential_schema<'life0, 'life1, 'life2, 'life3, 'async_trait>(
    &'life0 mut self,
    method: &'life1 str,
    options: &'life2 str,
    payload: &'life3 str
) -> Pin<Box<dyn Future<Output = Result<VadePluginResultValue<Option<String>>, Box<dyn Error>>> + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
    Self: 'async_trait, 
[src]

Creates a new zero-knowledge proof credential schema.

Note that options.identity needs to be whitelisted for this function.

Arguments

Returns

  • Option<String> - The created schema as a JSON object

fn vc_zkp_create_revocation_registry_definition<'life0, 'life1, 'life2, 'life3, 'async_trait>(
    &'life0 mut self,
    method: &'life1 str,
    options: &'life2 str,
    payload: &'life3 str
) -> Pin<Box<dyn Future<Output = Result<VadePluginResultValue<Option<String>>, Box<dyn Error>>> + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
    Self: 'async_trait, 
[src]

Creates a new revocation registry definition and stores it on-chain. The definition consists of a public and a private part. The public part holds the cryptographic material needed to create non-revocation proofs. The private part needs to reside with the registry owner and is used to revoke credentials.

Note that options.identity needs to be whitelisted for this function.

Arguments

Returns

fn vc_zkp_issue_credential<'life0, 'life1, 'life2, 'life3, 'async_trait>(
    &'life0 mut self,
    method: &'life1 str,
    _options: &'life2 str,
    payload: &'life3 str
) -> Pin<Box<dyn Future<Output = Result<VadePluginResultValue<Option<String>>, Box<dyn Error>>> + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
    Self: 'async_trait, 
[src]

Issues a new credential. This requires an issued schema, credential definition, an active revocation registry and a credential request message.

Arguments

  • method - method to issue a credential for (e.g. "did:example")
  • _options - no authenticated request required, so can be left empty
  • payload - serialized IssueCredentialPayload

Returns

  • serialized IssueCredentialResult consisting of the credential, this credential's initial revocation state and the updated revocation info, only interesting for the issuer (needs to be stored privately)

fn vc_zkp_create_credential_offer<'life0, 'life1, 'life2, 'life3, 'async_trait>(
    &'life0 mut self,
    method: &'life1 str,
    _options: &'life2 str,
    payload: &'life3 str
) -> Pin<Box<dyn Future<Output = Result<VadePluginResultValue<Option<String>>, Box<dyn Error>>> + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
    Self: 'async_trait, 
[src]

Creates a CredentialOffer message. A CredentialOffer is sent by an issuer and is the response to a CredentialProposal. The CredentialOffer specifies which schema and definition the issuer is capable and willing to use for credential issuance.

Arguments

  • method - method to create a credential offer for (e.g. "did:example")
  • _options - no authenticated request required, so can be left empty
  • payload - serialized OfferCredentialPayload

Returns

  • Option<String> - The offer as a JSON object

fn vc_zkp_present_proof<'life0, 'life1, 'life2, 'life3, 'async_trait>(
    &'life0 mut self,
    method: &'life1 str,
    _options: &'life2 str,
    payload: &'life3 str
) -> Pin<Box<dyn Future<Output = Result<VadePluginResultValue<Option<String>>, Box<dyn Error>>> + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
    Self: 'async_trait, 
[src]

Presents a proof for one or more credentials. A proof presentation is the response to a proof request. The proof needs to incorporate all required fields from all required schemas requested in the proof request.

Arguments

  • method - method to presents a proof for (e.g. "did:example")
  • _options - no authenticated request required, so can be left empty
  • payload - serialized PresentProofPayload

Returns

  • Option<String> - The offer as a JSON object

fn vc_zkp_create_credential_proposal<'life0, 'life1, 'life2, 'life3, 'async_trait>(
    &'life0 mut self,
    method: &'life1 str,
    _options: &'life2 str,
    payload: &'life3 str
) -> Pin<Box<dyn Future<Output = Result<VadePluginResultValue<Option<String>>, Box<dyn Error>>> + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
    Self: 'async_trait, 
[src]

Creates a new zero-knowledge proof credential proposal. This message is the first in the credential issuance flow and is sent by the potential credential holder to the credential issuer.

Arguments

  • method - method to create a credential proposal for (e.g. "did:example")
  • _options - no authenticated request required, so can be left empty
  • payload - serialized CreateCredentialProposalPayload

Returns

  • Option<String> - The proposal as a JSON object

fn vc_zkp_request_credential<'life0, 'life1, 'life2, 'life3, 'async_trait>(
    &'life0 mut self,
    method: &'life1 str,
    _options: &'life2 str,
    payload: &'life3 str
) -> Pin<Box<dyn Future<Output = Result<VadePluginResultValue<Option<String>>, Box<dyn Error>>> + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
    Self: 'async_trait, 
[src]

Requests a credential. This message is the response to a credential offering and is sent by the potential credential holder. It incorporates the target schema, credential definition offered by the issuer, and the encoded values the holder wants to get signed. The credential is not stored on-chain and needs to be kept private.

Arguments

  • method - method to request a credential for (e.g. "did:example")
  • _options - no authenticated request required, so can be left empty
  • payload - serialized RequestCredentialPayload

Returns

  • Option<String> - A JSON object consisting of the CredentialRequest and CredentialSecretsBlindingFactors (to be stored at the proofer's site in a private manner)

fn vc_zkp_request_proof<'life0, 'life1, 'life2, 'life3, 'async_trait>(
    &'life0 mut self,
    method: &'life1 str,
    _options: &'life2 str,
    payload: &'life3 str
) -> Pin<Box<dyn Future<Output = Result<VadePluginResultValue<Option<String>>, Box<dyn Error>>> + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
    Self: 'async_trait, 
[src]

Requests a zero-knowledge proof for one or more credentials issued under one or more specific schemas and is sent by a verifier to a prover. The proof request consists of the fields the verifier wants to be revealed per schema.

Arguments

  • method - method to request a proof for (e.g. "did:example")
  • _options - no authenticated request required, so can be left empty
  • payload - serialized RequestProofPayload

Returns

  • Option<String> - A ProofRequest as JSON

fn vc_zkp_revoke_credential<'life0, 'life1, 'life2, 'life3, 'async_trait>(
    &'life0 mut self,
    method: &'life1 str,
    options: &'life2 str,
    payload: &'life3 str
) -> Pin<Box<dyn Future<Output = Result<VadePluginResultValue<Option<String>>, Box<dyn Error>>> + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
    Self: 'async_trait, 
[src]

Revokes a credential. After revocation the published revocation registry needs to be updated with information returned by this function. To revoke a credential, tbe revoker must be in possession of the private key associated with the credential's revocation registry. After revocation, the published revocation registry must be updated. Only then is the credential truly revoked.

Note that options.identity needs to be whitelisted for this function.

Arguments

Returns

  • Option<String> - The updated revocation registry definition as a JSON object. Contains information needed to update the respective revocation registry.

fn vc_zkp_verify_proof<'life0, 'life1, 'life2, 'life3, 'async_trait>(
    &'life0 mut self,
    method: &'life1 str,
    _options: &'life2 str,
    payload: &'life3 str
) -> Pin<Box<dyn Future<Output = Result<VadePluginResultValue<Option<String>>, Box<dyn Error>>> + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
    Self: 'async_trait, 
[src]

Verifies one or multiple proofs sent in a proof presentation.

Arguments

  • method - method to verify a proof for (e.g. "did:example")
  • _options - no authenticated request required, so can be left empty
  • payload - serialized ValidateProofPayload

Returns

  • Option<String> - A JSON object representing a ProofVerification type, specifying whether verification was successful

Auto Trait Implementations

impl !RefUnwindSafe for VadeEvan

impl !Send for VadeEvan

impl !Sync for VadeEvan

impl Unpin for VadeEvan

impl !UnwindSafe for VadeEvan

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, Outer> IsWrappedBy<Outer> for T where
    Outer: AsRef<T> + AsMut<T> + From<T>,
    T: From<Outer>, 
[src]

fn from_ref(outer: &Outer) -> &T[src]

Get a reference to the inner from the outer.

fn from_mut(outer: &mut Outer) -> &mut T[src]

Get a mutable reference to the inner from the outer.

impl<T> MaybeDebug for T

impl<T> MaybeRefUnwindSafe for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<S, T> UncheckedInto<T> for S where
    T: UncheckedFrom<S>, 
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,