Created
June 12, 2017 18:17
-
-
Save zapu/7ce0576acad346f0237e81d684cd089e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kbpgp = require '../kbpgp' | |
{Message} = kbpgp.processor | |
await kbpgp.KeyManager.import_from_armored_pgp { | |
armored: """-----BEGIN PGP PUBLIC KEY BLOCK----- | |
mI0EWT7ZgAEEAMzYy+AJehsdFUEbY2hcY32qHe0QaqX/OMm97TGcGx/v1Fvtn3l1 | |
7LnFAe7aDlBn1VnCqnqrU5lDjcY9mep0FuphYvPdoHVydbhxa0hwRr0UcyZ+caRj | |
yooG7FKmguqlr+yKe7qK13nOGeHcNSCP/1pRh6/IUnt6HIRb+zMBFl7hABEBAAG0 | |
EFJTQSBDcmFzaGVyIFRlc3SItwQTAQgAIQUCWT7ZgAIbAwULCQgHAgYVCAkKCwIE | |
FgIDAQIeAQIXgAAKCRDkS/dyJqi3NkjtA/42AmG8M2fpnA/JQKuu+Qy0bJtICgqj | |
qRvjpXJZQCbZViHxCLpACfhqOKMqL/ih+IBR/oW4+LvIzmXu4NcUHydAia0e2Mow | |
Xw+8gWQLpYyeb1a871KbZY68e5kMxIpXfFi+WLorIiqckbrsRcNXARcd/J280Cid | |
HWZdi/nF9dGB/LiNBFk+2YABBACsxXQoBbESrMSYXtaBNWmI/ZpPBiPEXfvGcurW | |
34rOIjNFKtlpMIexzSByHOji7MIcuUdIsPR6feVzFKpBxxlxvGEDbD7ZMjsAP+mq | |
+3LpTimUraGADCkMUtkM0lazO8QASZ0kyyu5ny4n6/QBDWg65Fnqg+itydTYi5g9 | |
kiY+3QARAQABiJ8EGAEIAAkFAlk+2YACGwwACgkQ5Ev3ciaotzacFgP/YdSeBlkb | |
UZ8gNS4YZbVrCtwNmR0v6sCmnV2UEkIEvnmhReBQjWk2zEjcQ08PrmVCS5TdN+GL | |
btbcaXIA33xgPk/BtukdPrtJDsY7MSUaQmQjS8YS2+bGGE94hKFM+PcScgZ+KSyb | |
Ec91fZC5vIGGtc7fbB8dy1+iOe2mTwkzwcY= | |
=ZN31 | |
-----END PGP PUBLIC KEY BLOCK----- | |
""" | |
}, defer err, mallory, warnings | |
proc = new Message { keyfetch : mallory } | |
msg = """-----BEGIN PGP MESSAGE----- | |
hIwDngMwVxC7skYBBACchO7qwsZijeI3/LeJ0yM7INw2m+mHiRRjU3y0eaEcMO5O | |
Ehsh6oR5durkChbvBaFomwDL9plm+VtdCkmaGv8rXtubjWUKDZzyZqBjUK0gkzdY | |
8Sr4DF/VBJOZYZzashSYehatRvP1xmucmy7Fs4O3b6xwHAfMA9hrUKNLIqw5UNJB | |
Af2rUEQbnmaih0pJAkwEvyziczzWh1qGF1lX2i0/s5X8/dMnaOamRhNd5+WakG/P | |
KvM54Cs1mx1a8u+Cnc18Pgk= | |
=ukSg | |
-----END PGP MESSAGE----- | |
""" | |
[err,msg] = kbpgp.armor.decode msg | |
await proc.parse_and_process msg, defer err, literals | |
console.log err | |
console.log literals |
maxtaco
commented
Jun 12, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment