From b76c67aba86eba194d2e70412622aeedfb48a9e9 Mon Sep 17 00:00:00 2001 From: chenlhlinux Date: Fri, 13 Mar 2020 03:13:22 +0800 Subject: [PATCH] Fix signature verification examples in the README (#1058) --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d2ded7236..7dfa559ef 100644 --- a/README.md +++ b/README.md @@ -460,7 +460,7 @@ Using the private key: }); console.log(cleartext); // '-----BEGIN PGP SIGNED MESSAGE ... END PGP SIGNATURE-----' - const { signatures } = await openpgp.verify({ + const verified = await openpgp.verify({ message: await openpgp.cleartext.readArmored(cleartext), // parse armored message publicKeys: (await openpgp.key.readArmored(publicKeyArmored)).keys // for verification }); @@ -495,7 +495,7 @@ Using the private key: }); console.log(detachedSignature); - const { signatures } = await openpgp.verify({ + const verified = await openpgp.verify({ message: openpgp.cleartext.fromText('Hello, World!'), // CleartextMessage or Message object signature: await openpgp.signature.readArmored(detachedSignature), // parse detached signature publicKeys: (await openpgp.key.readArmored(publicKeyArmored)).keys // for verification @@ -537,7 +537,7 @@ Using the private key: }); console.log(signatureArmored); // ReadableStream containing '-----BEGIN PGP MESSAGE ... END PGP MESSAGE-----' - const { signatures } = await openpgp.verify({ + const verified = await openpgp.verify({ message: await openpgp.message.readArmored(signatureArmored), // parse armored signature publicKeys: (await openpgp.key.readArmored(publicKeyArmored)).keys // for verification });