Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@digitalbazaar/vc

Package Overview
Dependencies
Maintainers
5
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@digitalbazaar/vc - npm Package Compare versions

Comparing version 6.0.1 to 6.0.2

18

lib/index.js

@@ -142,3 +142,3 @@ /**

// run common credential checks
_checkCredential({credential, now});
_checkCredential({credential, now, mode: 'issue'});

@@ -540,3 +540,3 @@ return jsigs.sign(credential, {purpose, documentLoader, suite});

*/
export function _checkCredential({credential, now = new Date()}) {
export function _checkCredential({credential, now = new Date(), mode = 'verify'}) {
if(typeof now === 'string') {

@@ -591,8 +591,10 @@ now = new Date(now);

}
// check if `now` is before `issuanceDate`
issuanceDate = new Date(issuanceDate);
if(now < issuanceDate) {
throw new Error(
`The current date time (${now.toISOString()}) is before the ` +
`"issuanceDate" (${issuanceDate.toISOString()}).`);
// check if `now` is before `issuanceDate` on verification
if(mode === 'verify') {
issuanceDate = new Date(issuanceDate);
if(now < issuanceDate) {
throw new Error(
`The current date time (${now.toISOString()}) is before the ` +
`"issuanceDate" (${issuanceDate.toISOString()}).`);
}
}

@@ -599,0 +601,0 @@ }

{
"name": "@digitalbazaar/vc",
"version": "6.0.1",
"version": "6.0.2",
"description": "Verifiable Credentials JavaScript library.",

@@ -85,3 +85,3 @@ "homepage": "https://github.com/digitalbazaar/vc",

"test-karma": "karma start karma.conf.cjs",
"lint": "eslint .",
"lint": "eslint 'lib/**/*.js' 'test/**/*.js'",
"coverage": "cross-env NODE_ENV=test c8 npm run test-node",

@@ -88,0 +88,0 @@ "coverage-ci": "cross-env NODE_ENV=test c8 --reporter=lcovonly --reporter=text-summary --reporter=text npm run test-node",

# Verifiable Credentials JS Library _(@digitalbazaar/vc)_
[![Build Status](https://img.shields.io/github/workflow/status/digitalbazaar/vc/Node.js%20CI)](https://github.com/digitalbazaar/vc/actions?query=workflow%3A%22Node.js+CI%22)
[![Build Status](https://img.shields.io/github/actions/workflow/status/digitalbazaar/vc/main.yml)](https://github.com/digitalbazaar/vc/actions/workflow/main.yml)
[![NPM Version](https://img.shields.io/npm/v/@digitalbazaar/vc.svg)](https://npm.im/@digitalbazaar/vc)

@@ -5,0 +5,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc