Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions bindings/wasm/examples/src/0_basic/6_create_vp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,10 @@ export async function createVP() {
// ===========================================================================
// Step 6: Holder sends a verifiable presentation to the verifier.
// ===========================================================================
const presentationJwtToVerifier = presentationJwt.toString();
console.log(
`Sending presentation (as JWT) to the verifier`,
unsignedVp.toJSON(),
presentationJwtToVerifier,
);

// ===========================================================================
Expand All @@ -173,14 +174,15 @@ export async function createVP() {
client: didClient,
});
// Resolve the presentation holder.
const presentationHolderDID: CoreDID = JwtPresentationValidator.extractHolder(presentationJwt);
const receivedVpJwt = new Jwt(presentationJwtToVerifier);
const presentationHolderDID: CoreDID = JwtPresentationValidator.extractHolder(receivedVpJwt);
const resolvedHolder = await resolver.resolve(
presentationHolderDID.toString(),
);

// Validate presentation. Note that this doesn't validate the included credentials.
let decodedPresentation = new JwtPresentationValidator(new EdDSAJwsVerifier()).validate(
presentationJwt,
receivedVpJwt,
resolvedHolder,
jwtPresentationValidationOptions,
);
Expand Down
Loading