diff --git a/src/utils.js b/src/utils.js new file mode 100644 index 0000000..0a333d5 --- /dev/null +++ b/src/utils.js @@ -0,0 +1,17 @@ +const generateClaim = (spData) => { + switch (spData.claim.format) { + case 'uri': + return `openpgp4fpr:${spData.claim.fingerprint}` + break; + case 'message': + return `[Verifying my OpenPGP key: openpgp4fpr:${spData.claim.fingerprint}]` + break; + case 'fingerprint': + return pData.claim.fingerprint + break; + default: + throw new Error('No valid claim format') + } +} + +exports.generateClaim = generateClaim