{"action":"closed","issue":{"url":"https://api.github.com/repos/openpgpjs/openpgpjs/issues/351","labels_url":"https://api.github.com/repos/openpgpjs/openpgpjs/issues/351/labels{/name}","comments_url":"https://api.github.com/repos/openpgpjs/openpgpjs/issues/351/comments","events_url":"https://api.github.com/repos/openpgpjs/openpgpjs/issues/351/events","html_url":"https://github.com/openpgpjs/openpgpjs/issues/351","id":103928657,"number":351,"title":"Can't use signAndEncryptMessage()","user":{"login":"arget1313","id":13962079,"avatar_url":"https://avatars.githubusercontent.com/u/13962079?v=3","gravatar_id":"","url":"https://api.github.com/users/arget1313","html_url":"https://github.com/arget1313","followers_url":"https://api.github.com/users/arget1313/followers","following_url":"https://api.github.com/users/arget1313/following{/other_user}","gists_url":"https://api.github.com/users/arget1313/gists{/gist_id}","starred_url":"https://api.github.com/users/arget1313/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arget1313/subscriptions","organizations_url":"https://api.github.com/users/arget1313/orgs","repos_url":"https://api.github.com/users/arget1313/repos","events_url":"https://api.github.com/users/arget1313/events{/privacy}","received_events_url":"https://api.github.com/users/arget1313/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-30T14:36:33Z","updated_at":"2015-08-31T09:37:44Z","closed_at":"2015-08-31T09:37:44Z","body":"This is my code:\r\n<pre>\r\n&lt;script type=\"text/javascript\" src=\"openpgpjs/dist/openpgp.js\"&gt;&lt;/script&gt;\r\n&lt;script type=\"text/javascript\"&gt;\r\n    var PBK = '-----BEGIN PGP PUBLIC KEY BLOCK-----...';\r\n    var PVK = '-----BEGIN PGP PRIVATE KEY BLOCK-----...';\r\n    var publicKey = openpgp.key.readArmored(PBK);\r\n    var privateKey = openpgp.key.readArmored(PVK).keys[0];\r\n    privateKey.decrypt(\"qwerty\");\r\n    openpgp.signAndEncryptMessage\r\n    (\r\n        publicKey.keys,\r\n        privateKey.keys,\r\n        \"Message\"\r\n    ).then(function(pgpMessage){\r\n        document.write(pgpMessage);\r\n    })}\r\n&lt;/script&gt;\r\n</pre>\r\nIn console appears:\r\nError: Error signing and encrypting message! openpgp.js:12539:8\r\n\r\nWhat am I doing wrong?\r\n"}}