Fixes detached signing/verification example in README.md; Closes #622

This commit is contained in:
Mahrud Sayrafi 2018-02-12 10:25:29 -08:00
parent 6578a57968
commit f113078f65
No known key found for this signature in database
GPG Key ID: C24071B956C3245F

View File

@ -246,7 +246,7 @@ openpgp.verify(options).then(function(verified) {
#### Create and verify *detached* signatures
```js
var options, cleartext, detachedSig, validity;
var options, detachedSig, validity;
var pubkey = '-----BEGIN PGP PUBLIC KEY BLOCK ... END PGP PUBLIC KEY BLOCK-----';
var privkey = '-----BEGIN PGP PRIVATE KEY BLOCK ... END PGP PRIVATE KEY BLOCK-----'; //encrypted private key
@ -264,7 +264,6 @@ options = {
};
openpgp.sign(options).then(function(signed) {
cleartext = signed.data;
detachedSig = signed.signature;
});
```
@ -272,7 +271,7 @@ openpgp.sign(options).then(function(signed) {
```js
options = {
message: openpgp.cleartext.readArmored(cleartext), // parse armored message
message: openpgp.message.fromText('Hello, World!'), // input as Message object
signature: openpgp.signature.readArmored(detachedSig), // parse detached signature
publicKeys: openpgp.key.readArmored(pubkey).keys // for verification
};