79214809

Date: 2024-11-22 11:32:08
Score: 0.5
Natty:
Report link

I digged around the intetnet and find the answer.

const publicKey=await openpgp.readKey({ armoredKey:publicKeyArmored });
const td=new TextDecoder();

for(const {selfCertifications} of publicKey.users){
    if(selfCertifications.length==0)continue;
    const latestCert=selfCertifications.sort((a,b)=>
        b.created.getTime()-a.created.getTime()
    )[0];
    if(latestCert.revoked)continue;
    for(const {name,value} of latestCert.rawNotations){
        console.log(`${name}=${td.decode(value)}`);
    }
}
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: NyaightHazard