@arcblock/vc
Advanced tools
Comparing version 1.8.25 to 1.8.26
@@ -220,11 +220,11 @@ /** | ||
function createStatusList({ statusList, issuer, issuanceDate }) { | ||
if (!statusList || !Array.isArray(statusList) || !statusList.length) { | ||
throw new Error('Can not create with empty status list'); | ||
function createCredentialList({ claims, issuer, issuanceDate }) { | ||
if (!claims || !Array.isArray(claims) || !claims.length) { | ||
throw new Error('Can not create credential list with empty claim list'); | ||
} | ||
if (!issuer || !issuer.wallet || !issuer.name) { | ||
throw new Error('Can not create with empty issuer name or wallet'); | ||
throw new Error('Can not create credential list with empty issuer name or wallet'); | ||
} | ||
if (typeof issuer.wallet.sign !== 'function') { | ||
throw new Error('Can not create with invalid issuer wallet'); | ||
throw new Error('Can not create credential list with invalid issuer wallet'); | ||
} | ||
@@ -239,3 +239,3 @@ | ||
return statusList.map((x) => { | ||
return claims.map((x) => { | ||
const vc = { claim: x }; | ||
@@ -263,8 +263,8 @@ | ||
function verifyStatusList({ statusList, trustedIssuers }) { | ||
if (!statusList || !Array.isArray(statusList) || !statusList.length) { | ||
throw new Error('Can not verify with empty status list'); | ||
function verifyCredentialList({ credentials, trustedIssuers }) { | ||
if (!credentials || !Array.isArray(credentials) || !credentials.length) { | ||
throw new Error('Can not verify with empty credentials list'); | ||
} | ||
return statusList.map((x) => { | ||
return credentials.map((x) => { | ||
// Verify issuer | ||
@@ -274,6 +274,6 @@ const issuers = Array.isArray(trustedIssuers) ? trustedIssuers : [trustedIssuers]; | ||
if (!issuerDid) { | ||
throw new Error('Status credential not issued by trusted issuers'); | ||
throw new Error('Credential not issued by trusted issuers'); | ||
} | ||
if (!isFromPublicKey(issuerDid, x.issuer.pk)) { | ||
throw new Error('Status credential not issuer pk not match with issuer did'); | ||
throw new Error('Credential not issuer pk not match with issuer did'); | ||
} | ||
@@ -288,3 +288,2 @@ | ||
delete clone.proof; | ||
delete clone.signature; | ||
@@ -306,4 +305,4 @@ // Verify signature | ||
proofTypes, | ||
createStatusList, | ||
verifyStatusList, | ||
createCredentialList, | ||
verifyCredentialList, | ||
}; |
{ | ||
"name": "@arcblock/vc", | ||
"version": "1.8.25", | ||
"version": "1.8.26", | ||
"description": "Javascript lib to work with ArcBlock Verifiable Credentials", | ||
@@ -48,6 +48,6 @@ "keywords": [ | ||
"dependencies": { | ||
"@arcblock/did": "^1.8.25", | ||
"@ocap/mcrypto": "^1.8.25", | ||
"@ocap/util": "^1.8.25", | ||
"@ocap/wallet": "^1.8.25", | ||
"@arcblock/did": "^1.8.26", | ||
"@ocap/mcrypto": "^1.8.26", | ||
"@ocap/util": "^1.8.26", | ||
"@ocap/wallet": "^1.8.26", | ||
"debug": "^4.3.1", | ||
@@ -57,3 +57,3 @@ "json-stable-stringify": "^1.0.1", | ||
}, | ||
"gitHead": "c8142759941802cbefefec343b2a4835b75fe4f9" | ||
"gitHead": "72840b219e0b8ac9c74744dd05cfc3bc87038245" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14473
312
Updated@arcblock/did@^1.8.26
Updated@ocap/mcrypto@^1.8.26
Updated@ocap/util@^1.8.26
Updated@ocap/wallet@^1.8.26