mirror of
https://github.com/tlsnotary/explorer.git
synced 2026-01-09 21:07:55 -05:00
feature: fetch public key from notaryUrl in proof on upload
This commit is contained in:
@@ -33,7 +33,13 @@ export default function FileDrop(): ReactElement {
|
||||
let verifiedProof: Proof;
|
||||
const proofContent = await readFileAsync(file);
|
||||
try {
|
||||
verifiedProof = await verify(JSON.parse(proofContent), notaryKey);
|
||||
let pubKey: any;
|
||||
if (JSON.parse(proofContent).notaryUrl) {
|
||||
const notaryFetch = await fetch(JSON.parse(proofContent).notaryUrl + '/info');
|
||||
const notaryData = await notaryFetch.json();
|
||||
pubKey = notaryData.publicKey;
|
||||
}
|
||||
verifiedProof = await verify(JSON.parse(proofContent), pubKey || notaryKey);
|
||||
setVerifiedProof(verifiedProof);
|
||||
} catch(e) {
|
||||
setError(e as string);
|
||||
|
||||
@@ -27,7 +27,7 @@ export default function SharedProof(): ReactElement {
|
||||
}
|
||||
const data = await response.json();
|
||||
try {
|
||||
let pubKey;
|
||||
let pubKey: any;
|
||||
if (data.notaryUrl) {
|
||||
const notaryFetch = await fetch(data.notaryUrl + '/info');
|
||||
const notaryData = await notaryFetch.json();
|
||||
|
||||
Reference in New Issue
Block a user