mirror of
https://codeberg.org/keyoxide/doipjs.git
synced 2024-12-22 22:49:28 -07:00
Add utils
This commit is contained in:
parent
94dcfcca52
commit
1f29accb5f
1 changed files with 17 additions and 0 deletions
17
src/utils.js
Normal file
17
src/utils.js
Normal file
|
@ -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
|
Loading…
Reference in a new issue