@blockcerts/blockcerts-verifier 1.62.2 → 1.64.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-jnIXPui8-Ecil79Z6.js → EcdsaSd2023-C-1LsSqc-ObXBX61N.js} +8 -8
- package/dist/EcdsaSecp256k1Signature2019-9eEnZ1FG-BmfqA6PL.js +1 -0
- package/dist/Ed25519Signature2020-BMcgU5hX-x_NYJtpB.js +52 -0
- package/dist/HashlinkVerifier-BtvQtMxp-dg5WNZnc.js +11 -0
- package/dist/{MerkleProof2017-Cy_nkz4C-gnoFFWMW.js → MerkleProof2017-CYhvkyFU-Dl5-uCC8.js} +1 -1
- package/dist/MerkleProof2019-DvKX1MAC-ZkVAsaEc.js +3 -0
- package/dist/checkCredentialSchemaConformity-BKqGaA0B-BD_kUjvp.js +1 -0
- package/dist/{controlVerificationMethod-BxseSDWK-Ghg2o_Hj.js → controlVerificationMethod-CxlzFjkZ-PQqX7CMl.js} +1 -1
- package/dist/did-key-common.esm-BFTxB53c-CbGeVC_r.js +9 -0
- package/dist/did-key-ed25519.esm-De8G8Ym_-DucypQMo.js +1 -0
- package/dist/did-key-secp256k1.esm-Bq_BYfMd-CQBo4Q3q.js +1 -0
- package/dist/elliptic-ChFQ9Ngs-BRLTdj5Y.js +1 -0
- package/dist/{ensureValidIssuingKey-C7MTkDyV-frafTbMl.js → ensureValidIssuingKey-CVj5gBFJ-wu9SdYxL.js} +1 -1
- package/dist/index-CXMZ9dwW-lR6I8M8V.js +1 -0
- package/dist/index-CZmdZxVn-C0eXpZGn.js +1 -0
- package/dist/index-DJ38G5vv-CIHAiYCe.js +22 -0
- package/dist/index-SE5hL_nS--rUcmgx9.js +60 -0
- package/dist/jsonld-DSQP4wXm-C61cS9xX.js +33 -0
- package/dist/main.js +122 -119
- package/dist/{retrieveVerificationMethodPublicKey-fVSjg83n-B4VhVtVk.js → retrieveVerificationMethodPublicKey-8w3WQciA-sHmGZCdE.js} +1 -1
- package/dist/sha256-4DF0Q3E2-C1PUWFZm.js +1 -0
- package/dist/webcrypto.es-SQMaF2SJ-B87Lqr9a.js +40 -0
- package/dist/x25519-KjRyLrTf-NSl6svWQ.js +1 -0
- package/package.json +2 -2
- package/dist/EcdsaSecp256k1Signature2019-CBV4BwnM-C2qGlq2W.js +0 -4
- package/dist/Ed25519Signature2020-MQoWd113-PNuci9U2.js +0 -52
- package/dist/HashlinkVerifier-DykIKn5i-CYewU55u.js +0 -11
- package/dist/MerkleProof2019-DpwH-snR-ClzVR6uC.js +0 -3
- package/dist/checkCredentialSchemaConformity-DOGmtCq0-CnEpCN-s.js +0 -1
- package/dist/did-key-common.esm-C42sQiXe-DN5hgDGM.js +0 -9
- package/dist/did-key-ed25519.esm-CO7qImeZ-BR5JRBUU.js +0 -1
- package/dist/did-key-secp256k1.esm-BblZ1xRe-4Ak_uTKC.js +0 -1
- package/dist/elliptic-6eMlPaPZ-CGOSt2J1.js +0 -1
- package/dist/index-BZds3Ljo-CHN5LgUq.js +0 -1
- package/dist/index-Dzjg2qbR-DK7tzt5T.js +0 -22
- package/dist/index-VOqA2-xz-CKqwdkuf.js +0 -70
- package/dist/index-WN144sZ6-DKm58evR.js +0 -3
- package/dist/jsonld-BpvX3DRL-qZrjsUmJ.js +0 -75
- package/dist/sha256-D_qJpPFT-BYFBxJ7m.js +0 -1
- package/dist/webcrypto.es-DQnPRx8R-BJSH271h.js +0 -41
- package/dist/x25519-Dm-l65ld-DcUk09rC.js +0 -1
- /package/dist/{checkRevocationStatusList2021-CNtaPjVp-XCu3zkCJ.js → checkRevocationStatusList2021-BUqNLYXm-XCu3zkCJ.js} +0 -0
- /package/dist/{ensureNotRevoked-D9_PlMpD-DvMIgM4L.js → ensureNotRevoked-JuH4UdyO-DvMIgM4L.js} +0 -0
- /package/dist/{index-CWugL4dz-Dgus2xdV.js → index-BcM1LBSs-Dgus2xdV.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as e,r as t,
|
|
1
|
+
import{d as e,r as t,a as i,V as s,b as r,e as o,f as a}from"./main.js";import"./pako.esm-DnD5dZGi-Bw1vqMku.js";import{j as n}from"./jsonld-DSQP4wXm-C61cS9xX.js";import{s as c}from"./sha256-4DF0Q3E2-C1PUWFZm.js";import{e as h}from"./ensureValidIssuingKey-CVj5gBFJ-wu9SdYxL.js";import"./index-BcM1LBSs-Dgus2xdV.js";import{S as u}from"./Suite-B7Vy9AuU-D1ucdMDB.js";function p(e){e=e.trim();const t=[];for(let i=0;i<e.length;i+=2)t.push(parseInt(e.substring(i,i+2),16));return t}function f(e){const t=o(e);return"proof"in t?function(e){const t=o(e);if(!Array.isArray(e.proof))return delete t.proof,t;const i=e.proof.find((e=>"ChainedProof2021"!==e.type));return t.proof=i,t}(t):("signature"in t&&delete t.signature,t)}async function l(e){e["@context"].find((e=>i(e)&&"@vocab"in e))||e["@context"].push({"@vocab":"http://fallback.org/"});const t=f(e),o={algorithm:"URDNA2015",format:"application/nquads",documentLoader:function(e){return e in a?{contextUrl:null,document:a[e],documentUrl:e}:n.documentLoader(e)}};let h;try{h=await n.normalize(t,o)}catch(e){throw console.error(e),new s("computeLocalHash",r("errors","failedJsonLdNormalization"))}const u=function(e){const t=e.split("\n"),i=/<http:\/\/fallback\.org\/(.*)>/,s=t.map((e=>i.exec(e))).filter((e=>null!=e));if(s.length>0){const e=s.map((e=>e[1])).sort();return Array.from(new Set(e))}return null}(h);if(u)throw new s("computeLocalHash",`${r("errors","foundUnmappedFields")}: ${u.join(", ")}`);return c(function(e){const t=[];for(let i=0;i<e.length;i++){let s=e.charCodeAt(i);s<128?t.push(s):s<2048?t.push(192|s>>6,128|63&s):s<55296||s>=57344?t.push(224|s>>12,128|s>>6&63,128|63&s):(i++,s=65536+((1023&s)<<10|1023&e.charCodeAt(i)),t.push(240|s>>18,128|s>>12&63,128|s>>6&63,128|63&s))}return t}(h))}var d;!function(e){e.getTransactionId="getTransactionId",e.computeLocalHash="computeLocalHash",e.fetchRemoteHash="fetchRemoteHash",e.parseIssuerKeys="parseIssuerKeys",e.compareHashes="compareHashes",e.checkMerkleRoot="checkMerkleRoot",e.checkReceipt="checkReceipt",e.checkAuthenticity="checkAuthenticity"}(d||(d={}));class y extends u{verificationProcess=[d.getTransactionId,d.computeLocalHash,d.fetchRemoteHash,d.compareHashes,d.checkMerkleRoot,d.checkReceipt,d.parseIssuerKeys,d.checkAuthenticity];transactionId;localHash;documentToVerify;txData;chain;explorerAPIs;receipt;issuerPublicKeyList;issuer;proof;type="MerkleProof2017";constructor(t){super(t),t.executeStep&&(this.executeStep=t.executeStep),this.documentToVerify=t.document,this.explorerAPIs=t.explorerAPIs,this.issuer=t.issuer,this.proof=t.proof,this.validateProofType(),this.receipt=this.documentToVerify.signature,this.chain=e.certificates.getChain("",this.receipt),this.transactionId=e.certificates.getTransactionId(this.receipt),this.adaptVerificationProcessToChain()}async init(){}async verifyProof(){for(const e of this.verificationProcess){if(!this[e])return void console.error("verification logic for",e,"not implemented");await this[e]()}}async verifyIdentity(){}getProofVerificationSteps(t){return this.verificationProcess.map((i=>e.verifier.convertToVerificationSubsteps(t,i)))}getIdentityVerificationSteps(){return[]}getIssuerPublicKey(){return e.chains.isMockChain(this.chain)?"This mock chain does not support issuing addresses":this.txData?this.txData.issuingAddress:void console.error("Trying to access issuing address when txData not available yet. Did you run the `verify` method yet?")}getIssuerName(){return this.issuer.name}getIssuerProfileDomain(){const e=new URL(this.getIssuerProfileUrl());return e?.hostname}getIssuerProfileUrl(){return this.issuer.id}getSigningDate(){return this.documentToVerify.issuedOn}getChain(){return this.chain}getReceipt(){return this.receipt}getTransactionIdString(){return e.certificates.getTransactionId(this.getReceipt())}getTransactionLink(){return e.certificates.getTransactionLink(this.getTransactionIdString(),this.getChain()).transactionLink}getRawTransactionLink(){return e.certificates.getTransactionLink(this.getTransactionIdString(),this.getChain()).rawTransactionLink}validateProofType(){if(this.proof.type[0]!==this.type)throw new Error(`Incompatible proof type passed. Expected: ${this.type}, Got: ${this.proof.type[0]}`)}adaptVerificationProcessToChain(){e.chains.isMockChain(this.chain)&&(t(this.verificationProcess,d.getTransactionId),t(this.verificationProcess,d.fetchRemoteHash),t(this.verificationProcess,d.parseIssuerKeys),t(this.verificationProcess,d.checkMerkleRoot),t(this.verificationProcess,d.checkAuthenticity))}async executeStep(e,t,i){throw new Error("doAction method needs to be overwritten by injecting from CVJS")}async getTransactionId(){await this.executeStep(d.getTransactionId,(()=>function(e){if("string"==typeof e&&e.length>0)return e;throw new s("getTransactionId",r("errors","isTransactionIdValid"))}(this.transactionId)),this.type)}async computeLocalHash(){this.localHash=await this.executeStep(d.computeLocalHash,(async()=>await l(this.documentToVerify)),this.type)}async fetchRemoteHash(){this.txData=await this.executeStep(d.fetchRemoteHash,(async()=>await e.verifier.lookForTx({transactionId:this.transactionId,chain:this.chain.code,explorerAPIs:this.explorerAPIs})),this.type)}async compareHashes(){await this.executeStep(d.compareHashes,(()=>function(e,t){if(e!==t)throw new s("compareHashes",r("errors","ensureHashesEqual"));return!0}(this.localHash,this.receipt.targetHash)),this.type)}async checkMerkleRoot(){await this.executeStep(d.checkMerkleRoot,(()=>function(e,t){if(e!==t)throw new s("checkMerkleRoot",r("errors","ensureMerkleRootEqual"));return!0}(this.receipt.merkleRoot,this.txData.remoteHash)),this.type)}async checkReceipt(){await this.executeStep(d.checkReceipt,(()=>{!function(e){let t=e.targetHash;const i=e.merkleRoot;try{const i=e.proof??e.path;if(i)for(const e in i){const r=i[e];let o;if(void 0!==r.left)o=p(`${r.left}${t}`),t=c(o);else{if(void 0===r.right)throw new s("checkReceipt","Trigger catch error.");o=p(`${t}${r.right}`),t=c(o)}}}catch(e){throw new s("checkReceipt",r("errors","ensureValidReceipt"))}if(t!==i)throw new s("checkReceipt",r("errors","invalidMerkleReceipt"))}(this.receipt)}),this.type)}async parseIssuerKeys(){this.issuerPublicKeyList=await this.executeStep(d.parseIssuerKeys,(()=>e.verifier.parseIssuerKeys(this.issuer)),this.type)}async checkAuthenticity(){await this.executeStep(d.checkAuthenticity,(()=>{h(this.issuerPublicKeyList,this.txData.issuingAddress,this.txData.time)}),this.type)}}export{y as default};
|