doipjs/src/utils.js

18 lines
410 B
JavaScript
Raw Normal View History

2020-10-24 16:39:43 -06:00
const generateClaim = (fingerprint, format) => {
switch (format) {
2020-10-24 16:31:14 -06:00
case 'uri':
2020-10-24 16:39:43 -06:00
return `openpgp4fpr:${fingerprint}`
2020-10-24 16:31:14 -06:00
break;
case 'message':
2020-10-24 16:39:43 -06:00
return `[Verifying my OpenPGP key: openpgp4fpr:${fingerprint}]`
2020-10-24 16:31:14 -06:00
break;
case 'fingerprint':
2020-10-24 16:39:43 -06:00
return fingerprint
2020-10-24 16:31:14 -06:00
break;
default:
throw new Error('No valid claim format')
}
}
exports.generateClaim = generateClaim