diff --git a/src/server/openpgpProfiles.js b/src/server/openpgpProfiles.js index d82eade..6eaaefa 100644 --- a/src/server/openpgpProfiles.js +++ b/src/server/openpgpProfiles.js @@ -58,7 +58,8 @@ const fetchWKD = (id) => { const hash = createHash('md5').update(id).digest('hex') if (c && await c.get(hash)) { - profile = doipjs.Claim.fromJson(JSON.parse(await c.get(hash))) + profile = doipjs.Profile.fromJSON(JSON.parse(await c.get(hash))) + return resolve(profile) } if (!profile) { @@ -147,7 +148,8 @@ const fetchHKP = (id, keyserverDomain) => { const hash = createHash('md5').update(`${query}__${keyserverDomainNormalized}`).digest('hex') if (c && await c.get(hash)) { - profile = doipjs.Claim.fromJson(JSON.parse(await c.get(hash))) + profile = doipjs.Profile.fromJSON(JSON.parse(await c.get(hash))) + return resolve(profile) } if (!profile) { diff --git a/static-src/kx-claim.js b/static-src/kx-claim.js index 75e7e40..87c9f42 100644 --- a/static-src/kx-claim.js +++ b/static-src/kx-claim.js @@ -45,7 +45,7 @@ export class Claim extends HTMLElement { } async verify() { - const claim = doipjs.Claim.fromJson(JSON.parse(this.getAttribute('data-claim'))); + const claim = doipjs.Claim.fromJSON(JSON.parse(this.getAttribute('data-claim'))); await claim.verify({ proxy: { policy: 'adaptive', @@ -59,7 +59,7 @@ export class Claim extends HTMLElement { updateContent(value) { const root = this; const claimJson = JSON.parse(value); - const claim = doipjs.Claim.fromJson(claimJson); + const claim = doipjs.Claim.fromJSON(claimJson); root.querySelector('.info .title').innerText = claimJson.display.name; root.querySelector('.info .subtitle').innerText = claimJson.display.serviceProviderName ??