@blockcerts/blockcerts-verifier 1.63.0 → 1.65.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle-stats.html +1 -1
- package/dist/{EcdsaSd2023-DZGap3SM-mPG0cLDm.js → EcdsaSd2023-CFEOfg7w-mH0iTn_o.js} +5 -5
- package/dist/{EcdsaSecp256k1Signature2019-n7E_p_GN-CK56BVKZ.js → EcdsaSecp256k1Signature2019-ubMolKKG--XgmQozH.js} +1 -1
- package/dist/{Ed25519Signature2020-_cT8vvaO-DsdBcpgb.js → Ed25519Signature2020-BZ-qRxuK-BYYEQJGi.js} +3 -3
- package/dist/{MerkleProof2017-C7joZBSg-D3Ose_hz.js → MerkleProof2017-8DlLs_7g-DQaM2JIJ.js} +1 -1
- package/dist/{MerkleProof2019-B6RcT8nL-CW7PatZk.js → MerkleProof2019-Cv-l9BBE-DWMqt_64.js} +2 -2
- package/dist/checkCredentialSchemaConformity-jTrYEW-3-Dd-TT_aS.js +1 -0
- package/dist/{controlVerificationMethod-DZMPBpH4-DAL92l4K.js → controlVerificationMethod-CXY1HfP3-B24OCl2R.js} +1 -1
- package/dist/{did-key-common.esm-Dpr3yDzE-TRogf7i4.js → did-key-common.esm-B-c4r5DX-DkFupqKN.js} +3 -3
- package/dist/{did-key-ed25519.esm-Cds5njOI-zlZoO68S.js → did-key-ed25519.esm-BcBjidXA-DBqZ-FkQ.js} +1 -1
- package/dist/{did-key-secp256k1.esm-D1IImaHL-CTenolkL.js → did-key-secp256k1.esm-6buyKG_l-BMESYfmC.js} +1 -1
- package/dist/index-CUYLWUzw-Bvbn47Hw.js +22 -0
- package/dist/{index-CAl7T2GU-LqbKlBZ6.js → index-D-CbTXp7-DPOLY-Lt.js} +1 -1
- package/dist/{index-Chj6rFU_-DwRdQV-L.js → index-hjoL_SpB-ntvlvLOE.js} +2 -2
- package/dist/main.js +119 -115
- package/dist/{retrieveVerificationMethodPublicKey-Dz3Z2B9t-C2YmGxIc.js → retrieveVerificationMethodPublicKey-DVFc1aT7-B_qGml2q.js} +1 -1
- package/package.json +2 -2
- package/dist/checkCredentialSchemaConformity-BFdwoe1d-SeiEjHaf.js +0 -1
- package/dist/index-ByRXJxEU-CtZ_5kyD.js +0 -22
- /package/dist/{HashlinkVerifier-DgB7rgX8-dg5WNZnc.js → HashlinkVerifier-_iTrfpkJ-dg5WNZnc.js} +0 -0
- /package/dist/{checkRevocationStatusList2021-BEXdT3FD-XCu3zkCJ.js → checkRevocationStatusList2021-BnjtBDNQ-XCu3zkCJ.js} +0 -0
- /package/dist/{elliptic-Bf4jfo3V-BRLTdj5Y.js → elliptic-C4nnFoxE-BRLTdj5Y.js} +0 -0
- /package/dist/{ensureNotRevoked-zJYOGU17-DvMIgM4L.js → ensureNotRevoked-DWOMZyzg-DvMIgM4L.js} +0 -0
- /package/dist/{ensureValidIssuingKey-DVA5iNXJ-wu9SdYxL.js → ensureValidIssuingKey-CCMYu_4t-wu9SdYxL.js} +0 -0
- /package/dist/{index-CgNQmXGo-Dgus2xdV.js → index-DGqgobGj-Dgus2xdV.js} +0 -0
- /package/dist/{index-DsWS3N1O-C0eXpZGn.js → index-DO31KEg9-C0eXpZGn.js} +0 -0
- /package/dist/{jsonld-CkyvX_Vg-C61cS9xX.js → jsonld-B5Vzncdv-C61cS9xX.js} +0 -0
- /package/dist/{sha256-Dr-8c5iF-C1PUWFZm.js → sha256-D1k1uYHq-C1PUWFZm.js} +0 -0
- /package/dist/{webcrypto.es-InUVnvpc-B87Lqr9a.js → webcrypto.es-DlDhx8-u-B87Lqr9a.js} +0 -0
- /package/dist/{x25519-KEey2Qx1-NSl6svWQ.js → x25519-BTjd7-6X-NSl6svWQ.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{V as e,d as i}from"./main.js";import{b as r}from"./index-
|
|
1
|
+
import{V as e,d as i}from"./main.js";import{b as r}from"./index-DGqgobGj-Dgus2xdV.js";function t(t,o){if(!t.verificationMethod)return void console.warn("No verification method found in the issuer document. This will likely become a requirement in the near future");const n=o.split("#")[1],d=t.verificationMethod.find((e=>e.id===`#${n}`||e.id===o));if(!d)throw new e("retrieveVerificationMethodPublicKey",`${r} - ${i.i18n.getText("errors","retrieveVerificationMethodPublicKey")}`);return d}export{t as r};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blockcerts/blockcerts-verifier",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.65.0",
|
|
4
4
|
"description": "A standalone universal viewer and verifier for blockcerts credentials",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"node": ">=18.0.0"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@blockcerts/cert-verifier-js": "^6.
|
|
14
|
+
"@blockcerts/cert-verifier-js": "^6.19.0",
|
|
15
15
|
"@blockcerts/cert-verifier-js-v1-legacy": "^4.0.1",
|
|
16
16
|
"@polymer/lit-element": "0.5.1",
|
|
17
17
|
"@polymer/polymer": "3.5.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r}from"./index-DsWS3N1O-C0eXpZGn.js";import{D as a,V as o,A as e,b as t}from"./main.js";var s=r();async function i(r,i){Array.isArray(i)||(i=[i]);for(const c of i){const i=await a({url:c.id});let n;try{n=JSON.parse(i)}catch(r){throw console.error(r),new Error(`Specified schema at url: ${c.id} could not be parsed`)}if(!s.validator(n)(r))throw new o(e.checkCredentialSchemaConformity,t("errors","checkCredentialSchemaConformity"))}}export{i as default};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import{d as e,e as t}from"./index-Chj6rFU_-DwRdQV-L.js";import{d as r}from"./base64url-Cy03LJLt-vkTPfQOh.js";import{g as n}from"./main.js";import{r as i}from"./elliptic-Bf4jfo3V-BRLTdj5Y.js";
|
|
2
|
-
/*!
|
|
3
|
-
* Copyright (c) 2023 Digital Bazaar, Inc. All rights reserved.
|
|
4
|
-
*/
|
|
5
|
-
const c="ECDSA",u=!0,y="https://w3id.org/security/suites/ecdsa-2019/v1",o="https://w3id.org/security/multikey/v1",s="z",a=new Uint8Array([231,1]),l=new Uint8Array([128,36]),p=new Uint8Array([129,36]),w=new Uint8Array([130,36]),b=new Uint8Array([134,33]),f=new Uint8Array([134,38]),k=new Uint8Array([135,38]),K=new Uint8Array([136,38]),m="P-256",d="P-384",h="P-521",v="K-256",g="SHA-256",A="SHA-384",U="SHA-512",M=globalThis.crypto,E=globalThis.CryptoKey??M.CryptoKey;function C({curve:e}){if(e===m||e===v)return g;if(e===d)return A;if(e===h)return U;throw new TypeError(`Unsupported curve "${e}".`)}
|
|
6
|
-
/*!
|
|
7
|
-
* Copyright (c) 2022-2023 Digital Bazaar, Inc. All rights reserved.
|
|
8
|
-
*/function j({publicMultikey:e}){if(e[0]===l[0]&&e[1]===l[1])return m;if(e[0]===p[0]&&e[1]===p[1])return d;if(e[0]===w[0]&&e[1]===w[1])return h;if(e[0]===a[0]&&e[1]===a[1])return v;throw new TypeError("Unsupported public multikey header.")}function x({secretMultikey:e}){if(e[0]===f[0]&&e[1]===f[1])return m;if(e[0]===k[0]&&e[1]===k[1])return d;if(e[0]===K[0]&&e[1]===K[1])return h;if(e[0]===b[0]&&e[1]===b[1])return v;throw new TypeError("Unsupported secret multikey header.")}function T({curve:e}){if(e===m||e===v)return 32;if(e===d)return 48;if(e===h)return 66;throw new TypeError(`Unsupported curve "${e}".`)}var P=i(),S=n(P);
|
|
9
|
-
/*!
|
|
10
|
-
* Copyright (c) 2022-2023 Digital Bazaar, Inc. All rights reserved.
|
|
11
|
-
*/
|
|
12
|
-
const V=new Map([[m,{secret:new Uint8Array([48,103,2,1,0,48,19,6,7,42,134,72,206,61,2,1,6,8,42,134,72,206,61,3,1,7,4,77,48,75,2,1,1,4,32]),public:new Uint8Array([161,36,3,34,0])}],[d,{secret:new Uint8Array([48,129,132,2,1,0,48,16,6,7,42,134,72,206,61,2,1,6,5,43,129,4,0,34,4,109,48,107,2,1,1,4,48]),public:new Uint8Array([161,52,3,50,0])}],[h,{secret:new Uint8Array([48,129,170,2,1,0,48,16,6,7,42,134,72,206,61,2,1,6,5,43,129,4,0,35,4,129,146,48,129,143,2,1,1,4,66]),public:new Uint8Array([161,70,3,68,0])}],[v,{secret:new Uint8Array([48,129,132,2,1,0,48,16,6,7,42,134,72,206,61,2,1,6,5,43,129,4,0,10,4,109,48,107,2,1,1,4,32]),public:new Uint8Array([161,68,3,66,0])}]]),$=new Map([[m,new Uint8Array([48,57,48,19,6,7,42,134,72,206,61,2,1,6,8,42,134,72,206,61,3,1,7,3,34,0])],[d,new Uint8Array([48,70,48,16,6,7,42,134,72,206,61,2,1,6,5,43,129,4,0,34,3,50,0])],[h,new Uint8Array([48,88,48,16,6,7,42,134,72,206,61,2,1,6,5,43,129,4,0,35,3,68,0])],[v,new Uint8Array([48,86,48,16,6,7,42,134,72,206,61,2,1,6,5,43,129,4,0,10,3,66,0])]]);function I(e){const t=new S.ec("secp256k1");return Uint8Array.from(t.keyFromPublic(e).getPublic(!1,"array"))}async function H({id:t,controller:r,secretKeyMultibase:n,publicKeyMultibase:i,keyAgreement:y=!1}){if(!i)throw new TypeError('The "publicKeyMultibase" property is required.');const o={id:t,controller:r};if(!i||"string"!=typeof i||i[0]!==s)throw new TypeError('"publicKeyMultibase" must be a multibase, base58-encoded string.');const a=e(i.slice(1)),l={name:y?"ECDH":c,namedCurve:j({publicMultikey:a})},p=function({publicMultikey:e}){const t=j({publicMultikey:e});let r=e.subarray(2);t===v&&(r=I(r));return function({curve:e,publicKey:t}){const r=$.get(e),n=new Uint8Array(r.length+t.length);let i=0;return n.set(r,i),i+=r.length,n.set(t,i),n}
|
|
13
|
-
/*!
|
|
14
|
-
* Copyright (c) 2023 Digital Bazaar, Inc. All rights reserved.
|
|
15
|
-
*/({curve:t,publicKey:r})}({publicMultikey:a}),w=y?[]:["verify"];if(l.namedCurve===v){const{Crypto:e}=await import("./webcrypto.es-InUVnvpc-B87Lqr9a.js"),t=new e;o.publicKey=await t.subtle.importKey("spki",p,l,u,w)}else o.publicKey=await M.subtle.importKey("spki",p,l,u,w);if(n){if("string"!=typeof n||n[0]!==s)throw new TypeError('"secretKeyMultibase" must be a multibase, base58-encoded string.');const t=e(n.slice(1));!function({secretMultikey:e,publicMultikey:t}){const r=j({publicMultikey:t}),n=x({secretMultikey:e});if(r!==n)throw new Error(`Public key curve ('${r}') does not match secret key curve ('${n}').`)}({secretMultikey:t,publicMultikey:a});const r=function({secretMultikey:e,publicMultikey:t}){const r=x({secretMultikey:e}),n=e.subarray(2),i=t.subarray(2);return function({curve:e,secretKey:t,publicKey:r}){const n=V.get(e);if(!n)throw new Error(`Unsupported curve "${e}".`);e===v&&(r=I(r));const i=new Uint8Array(n.secret.length+t.length+n.public.length+r.length);let c=0;return i.set(n.secret,c),c+=n.secret.length,i.set(t,c),c+=t.length,i.set(n.public,c),c+=n.public.length,i.set(r,c),i}({curve:r,secretKey:n,publicKey:i})}({secretMultikey:t,publicMultikey:a}),i=y?["deriveBits"]:["sign"];if(l.namedCurve===v){const{Crypto:e}=await import("./webcrypto.es-InUVnvpc-B87Lqr9a.js"),t=new e;o.secretKey=await t.subtle.importKey("pkcs8",r,l,u,i)}else o.secretKey=await M.subtle.importKey("pkcs8",r,l,u,i)}return o}function q({jwk:e}={}){if("EC"!==e?.kty)throw new TypeError('"jwk.kty" must be "EC".');const{crv:n}=e,i=T({curve:n}),c=r(e.x),u=r(e.y),y=new Uint8Array(2+(i+1));!function({curve:e,buffer:t}){if(e===m)t[0]=l[0],t[1]=l[1];else if(e===d)t[0]=p[0],t[1]=p[1];else if(e===h)t[0]=w[0],t[1]=w[1];else{if(e!==v)throw new TypeError(`Unsupported curve "${e}".`);t[0]=a[0],t[1]=a[1]}}({curve:n,buffer:y});const o=u[u.length-1]%2==0;y[2]=o?2:3,y.set(c,y.length-c.length);return s+t(y)}function B({jwk:e}={}){if("EC"!==e?.kty)throw new TypeError('"jwk.kty" must be "EC".');const{crv:n}=e,i=T({curve:n}),c=r(e.d),u=new Uint8Array(2+i);!function({curve:e,buffer:t}){if(e===m)t[0]=f[0],t[1]=f[1];else if(e===d)t[0]=k[0],t[1]=k[1];else if(e===h)t[0]=K[0],t[1]=K[1];else{if(e!==v)throw new TypeError(`Unsupported curve "${e}".`);t[0]=b[0],t[1]=b[1]}}({curve:e.crv,buffer:u}),u.set(c,u.length-c.length);return s+t(u)}const D=new Set(["EcdsaSecp256r1VerificationKey2019","EcdsaSecp384r1VerificationKey2019","EcdsaSecp521r1VerificationKey2019","EcdsaSecp256k1VerificationKey2019"]);async function J({keyPair:e}){if(!D.has(e.type))throw new TypeError(`Unsupported key type "${e.type}".`);if(e["@context"]||(e["@context"]=y),!function({document:e,contextUrl:t}){const r=e["@context"];return r===t||Array.isArray(r)&&r.includes(t)}
|
|
16
|
-
/*!
|
|
17
|
-
* Copyright (c) 2022-2023 Digital Bazaar, Inc. All rights reserved.
|
|
18
|
-
*/({document:e,contextUrl:y}))throw new TypeError(`Context not supported "${e["@context"]}".`);return{"@context":o,id:e.id,type:"Multikey",controller:e.controller,publicKeyMultibase:e.publicKeyMultibase,secretKeyMultibase:e.secretKeyMultibase}}async function _(e,t={}){"boolean"==typeof t&&(t={keyAgreement:t});const{keyAgreement:r}=t;let n={...e};if("Multikey"!==n.type){if(n.publicKeyJwk)return async function({jwk:e,secretKey:t=!1}={}){const r={"@context":o,type:"Multikey",publicKeyMultibase:q({jwk:e})};t&&e.d&&(r.secretKeyMultibase=B({jwk:e}));const n=!e.key_ops||e.key_ops.includes("deriveBits");return _(r,n)}({jwk:n.publicKeyJwk,secretKey:!1});if(n.type)return n=await J({keyPair:n}),L({keyPair:n,keyAgreement:r})}return n.type||(n.type="Multikey"),n["@context"]||(n["@context"]=o),n.controller&&!n.id&&(n.id=`${e.controller}#${e.publicKeyMultibase}`),function(e){if(!e||"object"!=typeof e)throw new TypeError('"key" must be an object.');if("Multikey"!==e.type)throw new TypeError('"key" must be a Multikey with type "Multikey".');if(!(e["@context"]===o||Array.isArray(e["@context"])&&e["@context"].includes(o)))throw new TypeError(`"key" must be a Multikey with context "${o}".`)}(n),L({keyPair:n,keyAgreement:r})}async function F({keyPair:e,secretKey:t=!1}={}){e?.publicKey instanceof E||(e=await H(e));const r=t&&!!e.secretKey?e.secretKey:e.publicKey;let n;if(e.publicKey.algorithm.namedCurve===v){const{Crypto:e}=await import("./webcrypto.es-InUVnvpc-B87Lqr9a.js"),t=new e;n=await t.subtle.exportKey("jwk",r)}else n=await M.subtle.exportKey("jwk",r);return n}async function L({keyPair:e,keyAgreement:t=!1}){e?.publicKey instanceof E||e.publicKey?.algorithm.namedCurve===v||(e=await H(e));const n=async({publicKey:t=!0,secretKey:n=!1,includeContext:i=!0,raw:c=!1}={})=>{if(c){const i=await F({keyPair:e,secretKey:n}),c={};return t&&(c.publicKey=function({jwk:e}={}){if("EC"!==e?.kty)throw new TypeError('"jwk.kty" must be "EC".');const{crv:t}=e,n=T({curve:t}),i=r(e.x),c=r(e.y),u=new Uint8Array(n+1),y=c[c.length-1]%2==0;return u[0]=y?2:3,u.set(i,u.length-i.length),u}({jwk:i})),n&&(c.secretKey=function({jwk:e}={}){if("EC"!==e?.kty)throw new TypeError('"jwk.kty" must be "EC".');const{crv:t}=e,n=T({curve:t}),i=r(e.d),c=new Uint8Array(n);return c.set(i,c.length-i.length),c}({jwk:i})),c}return async function({keyPair:e,secretKey:t,publicKey:r,includeContext:n}={}){if(!r&&!t)throw new TypeError('Export requires specifying either "publicKey" or "secretKey".');const i=t&&!!e.secretKey,c=i?e.secretKey:e.publicKey;let u;if(c.algorithm.namedCurve===v){const{Crypto:e}=await import("./webcrypto.es-InUVnvpc-B87Lqr9a.js"),t=new e;u=await t.subtle.exportKey("jwk",c)}else u=await M.subtle.exportKey("jwk",c);const y={};return n&&(y["@context"]=o),y.id=e.id,y.type="Multikey",y.controller=e.controller,r&&(y.publicKeyMultibase=q({jwk:u})),i&&(y.secretKeyMultibase=B({jwk:u})),y}({keyPair:e,publicKey:t,secretKey:n,includeContext:i})},{publicKeyMultibase:i,secretKeyMultibase:u}=await n({publicKey:!0,secretKey:!0,includeContext:!0});return e={...e,publicKeyMultibase:i,secretKeyMultibase:u,keyAgreement:t,export:n,signer(){const{id:t,secretKey:r}=e;
|
|
19
|
-
/*!
|
|
20
|
-
* Copyright (c) 2022-2023 Digital Bazaar, Inc. All rights reserved.
|
|
21
|
-
*/
|
|
22
|
-
return function({id:e,secretKey:t}){if(!t)throw new Error('"secretKey" is required for signing.');const{namedCurve:r}=t.algorithm,n={name:c,hash:{name:C({curve:r})}};return{algorithm:r,id:e,async sign({data:e}={}){if(r===v){const{Crypto:r}=await import("./webcrypto.es-InUVnvpc-B87Lqr9a.js"),i=new r;return new Uint8Array(await i.subtle.sign(n,t,e))}return new Uint8Array(await M.subtle.sign(n,t,e))}}}({id:t,secretKey:r})},verifier(){const{id:t,publicKey:r}=e;return function({id:e,publicKey:t}){if(!t)throw new Error('"publicKey" is required for verifying.');const{namedCurve:r}=t.algorithm,n={name:c,hash:{name:C({curve:r})}};return{algorithm:r,id:e,async verify({data:e,signature:i}={}){if(r===v){const{Crypto:r}=await import("./webcrypto.es-InUVnvpc-B87Lqr9a.js");return(new r).subtle.verify(n,t,i,e)}return M.subtle.verify(n,t,i,e)}}}({id:t,publicKey:r})},async deriveSecret({publicKey:t,remotePublicKey:r}={}){if(r&&t)throw new Error('Only one of "remotePublicKey" and "publicKey" must be given.');if(!e.keyAgreement){const e=Error('"keyAgreement" is not supported by this keypair.');throw e.name="NotSupportedError",e}return async function({localKeyPair:e,remoteKeyPair:t}){if(!e.secretKey){const e=Error('"secretKey" required to derive secret.');throw e.name="NotSupportedError",e}e=await H({...e,keyAgreement:!0}),t=await H({...t,keyAgreement:!0});const{namedCurve:r}=e.secretKey.algorithm,n=T({curve:r});if(r===v){const{Crypto:i}=await import("./webcrypto.es-InUVnvpc-B87Lqr9a.js"),c=new i,u=await c.subtle.deriveBits({name:"ECDH",namedCurve:r,public:t.publicKey},e.secretKey,8*n);return new Uint8Array(u,0,n)}const i=await M.subtle.deriveBits({name:"ECDH",namedCurve:r,public:t.publicKey},e.secretKey,8*n);return new Uint8Array(i,0,n)}({localKeyPair:this,remoteKeyPair:r||t})}}}export{P as e,_ as f,F as t};
|
/package/dist/{HashlinkVerifier-DgB7rgX8-dg5WNZnc.js → HashlinkVerifier-_iTrfpkJ-dg5WNZnc.js}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/{ensureNotRevoked-zJYOGU17-DvMIgM4L.js → ensureNotRevoked-DWOMZyzg-DvMIgM4L.js}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|