diff --git a/src/signatures.js b/src/signatures.js index 932e740..9c6a387 100644 --- a/src/signatures.js +++ b/src/signatures.js @@ -20,7 +20,8 @@ const keys = require('./keys') const verify = (signature, opts) => { return new Promise(async (resolve, reject) => { - let errors = [], sigData + let errors = [], + sigData try { sigData = await openpgp.cleartext.readArmored(signature) } catch (error) { @@ -44,7 +45,7 @@ const verify = (signature, opts) => { case 'proof': sigClaims.push(match[2]) break - + default: break } @@ -54,10 +55,10 @@ const verify = (signature, opts) => { errors.push('no_linked_keys') reject({ errors: errors }) } - + const keyData = await keys.fetch.uri(sigKeys[0]) const fingerprint = keyData.keyPacket.getFingerprint() - + try { const sigVerification = await sigData.verify([keyData]) await sigVerification[0].verified @@ -72,9 +73,9 @@ const verify = (signature, opts) => { errors: errors, publicKey: keyData, fingerprint: fingerprint, - claims: claimVerifications + claims: claimVerifications, }) }) } -exports.verify = verify \ No newline at end of file +exports.verify = verify diff --git a/test/signatures.test.js b/test/signatures.test.js index 99bff16..b656c69 100644 --- a/test/signatures.test.js +++ b/test/signatures.test.js @@ -49,7 +49,9 @@ describe('signatures.verify', () => { it('should verify the demonstration signature', async () => { const verification = await doipjs.signatures.verify(sigProfile) expect(verification.errors).to.be.length(0) - expect(verification.fingerprint).to.be.equal('3637202523e7c1309ab79e99ef2dc5827b445f4b') + expect(verification.fingerprint).to.be.equal( + '3637202523e7c1309ab79e99ef2dc5827b445f4b' + ) expect(verification.claims).to.be.length(1) expect(verification.claims[0].isVerified).to.be.true })