mirror of
https://github.com/tlsnotary/explorer.git
synced 2026-01-10 15:28:06 -05:00
feature: fetch public key from notaryUrl in proof on shared proofs
This commit is contained in:
@@ -27,8 +27,15 @@ export default function SharedProof(): ReactElement {
|
||||
}
|
||||
const data = await response.json();
|
||||
try {
|
||||
const proof = await verify(data, notaryKey);
|
||||
console.log(data);
|
||||
let pubKey;
|
||||
if (data.notaryUrl) {
|
||||
const notaryFetch = await fetch(data.notaryUrl + '/info');
|
||||
const notaryData = await notaryFetch.json();
|
||||
pubKey = notaryData.publicKey;
|
||||
}
|
||||
|
||||
const proof = await verify(data, pubKey || notaryKey);
|
||||
|
||||
setVerifiedProof(proof);
|
||||
|
||||
} catch (e) {
|
||||
|
||||
@@ -25,7 +25,7 @@ type State = {
|
||||
}
|
||||
|
||||
const initState: State = {
|
||||
key: keys.defaultKey
|
||||
key: keys.notaryPseKey
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user