Skip to content
Merged
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
15 changes: 10 additions & 5 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,8 @@ async function _verifyOBv3LegacySignature(credential,
* @param {string|Date} [options.now] - A string representing date time in
* ISO 8601 format or an instance of Date. Defaults to current date time.
* @param {number} [options.version = 2.0] - The VC context version to use.
* @param {boolean} [options.verify=true]
* @param {boolean} [options.verify=true] - If set to true, throw verification
* errors for individual VCs (such as when the VC is expired, etc).
*
* @throws {TypeError} If verifiableCredential param is missing.
* @throws {Error} If the credential (or the presentation params) are missing
Expand All @@ -439,11 +440,15 @@ export function createPresentation({
};
if(verifiableCredential) {
const credentials = [].concat(verifiableCredential);
// ensure all credentials are valid
for(const credential of credentials) {
_checkCredential(
{credential, now, mode: verify ? 'verify' : 'do not force verify'});

if(verify) {
// ensure all credentials are valid and verified
for(const credential of credentials) {
_checkCredential(
{credential, now, mode: verify ? 'verify' : 'do not force verify'});
}
}

presentation.verifiableCredential = credentials;
}
if(id) {
Expand Down