question

CharlieHeinemann-7313 avatar image
0 Votes"
CharlieHeinemann-7313 asked

ION Tools - verifyJws doesn't return string on success, but boolean

When using ION tools (decentralized-identity/ion-tools) the documentation says verifyJws method returns signed text on success. But it seems to be returning just a boolean.

Here's the sample code in the documentation:

const jws = new ION.verifyJws({
jws: 'eyJhbGciOiJFUzI1NksifQ.ImhlbGxvIHdvcmxkIg.NK3f...',
privateJwk: { ... }
});

// RESULT
// success: returns 'hello world' to await/then(response)
// fail: throws verification error in try/catch(error)

When I run my code though (after ION.generateKeyPair()) I get a boolean and not a string on success:

const jws = await ION.signJws({
payload: 'hello world',
privateJwk: authnKeys.privateJwk
});

console.log(jws);

const decrypted = await ION.verifyJws({
jws: jws,
privateJwk: authnKeys.privateJwk
}).then(response => {console.log('response: ' + response)});

Anyone with any thoughts on this?

azure-ad-verifiable-credentials
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

0 Answers