From 5f7ce38be72a77ed4fa93359d81c2e14d16918c1 Mon Sep 17 00:00:00 2001 From: Tankred Hase Date: Thu, 18 Feb 2016 12:57:16 +0700 Subject: [PATCH] Fix examples in README --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 9896b7a8..56fec14c 100644 --- a/README.md +++ b/README.md @@ -59,8 +59,8 @@ options = { passwords: ['secret stuff'] // multiple passwords possible }; -openpgp.encrypt(options).then(function(armored) { - encrypted = armored; // '-----BEGIN PGP MESSAGE ... END PGP MESSAGE-----' +openpgp.encrypt(options).then(function(ciphertext) { + encrypted = ciphertext.data; // '-----BEGIN PGP MESSAGE ... END PGP MESSAGE-----' }); ``` @@ -71,7 +71,7 @@ options = { }; openpgp.decrypt(options).then(function(plaintext) { - // return 'Hello, World!' + return plaintext.data; // 'Hello, World!' }); ``` @@ -90,8 +90,8 @@ options = { armor: false // don't ASCII armor }; -openpgp.encrypt(options).then(function(message) { - encrypted = message.packets.write(); // get raw encrypted packets as Uint8Array +openpgp.encrypt(options).then(function(ciphertext) { + encrypted = ciphertext.message.packets.write(); // get raw encrypted packets as Uint8Array }); ``` @@ -104,7 +104,7 @@ options = { }; openpgp.decrypt(options).then(function(plaintext) { - // return Uint8Array([0x01, 0x01, 0x01]) + return plaintext.data // Uint8Array([0x01, 0x01, 0x01]) }); ```