Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

importKeys doesn't seem to work on a password-encrypted key #46

Open
mollyling opened this issue Jan 26, 2016 · 1 comment
Open

importKeys doesn't seem to work on a password-encrypted key #46

mollyling opened this issue Jan 26, 2016 · 1 comment

Comments

@mollyling
Copy link
Contributor

When exporting a EC256 private key from gpg2, with a simple password, I can't seem to get it imported. The E2E extension loads it fine.

function SearchAlicesKey() {
  console.log("SearchAlicesKey: running");
  alice.searchPrivateKey("[email protected]").then(
      function(v) {
        console.log("searchPrivateKey: Success", v);
      },
      LogFailureAndExit);
}
function LoadAlicesKey() {
  console.log("Loading Alice's Key");
  alice.importKeypair(loaded_messages.keys.password,
                      "[email protected]",
                      loaded_messages.keys.keys[0].private).then(
                          SearchAlicesKey,
                          SearchAlicesKey);
}

Where alice is an instance of pgpapi. Here's the key:

var raw_keys = [
  {
    "private": "-----BEGIN PGP PRIVATE KEY BLOCK-----\n" +
        "Version: GnuPG v2\n" +
        "\n" +
        "lKUEVqKVaRMIKoZIzj0DAQcCAwQj1vXJdzlfHhiXV5s0d9HK5q6edPgG9+uQVqYX\n" +
        "/aJy/BWbSDKfX8IHmKRhfB6Msg8XFxq3UbaeVuZNtgEifURX/gcDArDnmWfqHUtt\n" +
        "4jWQBri84gK6IMzvE/8TX902ntKCKqj/i2SgP85dzxFiAaaiWgupiQKJ33CygK4d\n" +
        "sf2rRnv771jceuVLSv1G8Jzny13Zx/+0G3VzZXItMCA8dXNlci0wQGV4YW1wbGUu\n" +
        "Y29tPoh5BBMTCAAhBQJWopVpAhsDBQsJCAcCBhUICQoLAgQWAgMBAh4BAheAAAoJ\n" +
        "EPcjztauAk2VBnQA/1fZHalPbVxALq09Yq7FNzghakHgoyEkwekbQ+KNGAeCAPsG\n" +
        "Hsd2asFC70XAnYADKJGxtKebNmHfWVyA6AjGJyFB75ypBFailWkSCCqGSM49AwEH\n" +
        "AgMEQqgnUFOXnwI6OMJnaIVtXl4c3OgdInRgUfjpT//PFhYz2FPqt4c/1pHYhzx/\n" +
        "6QqggObexKdY+dRZFS0DgL44MQMBCAf+BwMCB773+rJ/ncviTheSXe6VTgboxrTd\n" +
        "gKiQhCOAcByz/2cUUdyeeJ1p2qyzwNK1+8oWWiuGpbIS+FCpwTZO/ChqiVQed4i5\n" +
        "eD6IITRDuhaO5YhhBBgTCAAJBQJWopVpAhsMAAoJEPcjztauAk2VJQAA/18vW/TV\n" +
        "ZJTTD8JuOvtzNWConrcH/BzSUhgHTgLgr5DQAQD33WqSY/Jodb0hvu9+rl1kK35u\n" +
        "qqr9UVQ3ueoCthcknA==\n" +
        "=UuAm\n" +
        "-----END PGP PRIVATE KEY BLOCK-----",
 ...
}

Where raw_keys is eventually fed into the loaded_messages.keys[] array in the code.

@agallant
Copy link

agallant commented Feb 1, 2016

I think this is worth checking again now that #49 is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants