Skip to content

Commit

Permalink
Add prepare_proof function to Presentation
Browse files Browse the repository at this point in the history
Similar to Credential::prepare_proof
  • Loading branch information
clehner committed Mar 11, 2022
1 parent 8278650 commit 4a2b53a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/vc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1727,6 +1727,17 @@ impl Presentation {
LinkedDataProofs::sign(self, options, resolver, jwk, None).await
}

/// Prepare to generate a linked data proof. Returns the signing input for the caller to sign
/// and then pass to [`ProofPreparation::complete`] to complete the proof.
pub async fn prepare_proof(
&self,
public_key: &JWK,
options: &LinkedDataProofOptions,
resolver: &dyn DIDResolver,
) -> Result<ProofPreparation, Error> {
LinkedDataProofs::prepare(self, options, resolver, public_key, None).await
}

pub fn add_proof(&mut self, proof: Proof) {
self.proof = match self.proof.take() {
None => Some(OneOrMany::One(proof)),
Expand Down

0 comments on commit 4a2b53a

Please sign in to comment.