Skip to content

Sending signed vp as jwt to the verifier from the holder #1635

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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