Hi Sean, 

do you have any idea to correct my issue ? Do I use the function correctly ? 

Thanks for your help,
Regards.
Alex.



________________________________
 Envoyé le : Mercredi 24 juillet 2013 18h24
Objet : Error during key pair generation
 


Hi, 
I'm trying to make a simple key pair generation and it doesn't work, i have an 
error. 
This is my code : 

    funtion generateKeyPair() {
    if (window.crypto.getRandomValues) {

     openpgp.init();
     var keys = openpgp.generate_key_pair(1, 256, "foobar  <[email protected]>", 
"Something");
     alert(keys.publicKeyArmored);
        }
    }


I have this following error : 

    ERROR: openpgp.packet.keymaterial.js
    Failed reading public key portion of a private key: 81 3 176
     Aborting here...


And this one in the javascript console (using firebug): 

    TypeError: privKeyPacket is null
       if( !privKeyPacket.decryptSecretMPIs(passphrase))     openpgp.js (ligne 
8345)


If I take a look at the line 8345 in the openpgp.js file, I have this : 

    8344                var privKeyPacket = new 
openpgp_packet_keymaterial().read_priv_key(privKeyString.string,3,privKeyString.string.length);
    8345                if( !privKeyPacket.decryptSecretMPIs(passphrase))
    8346                    util.print_error('Issue creating key. Unable to 
read resulting private key');


So "privKeyPacket" is null, but i don't understand why ??
Does anyone can tell me what's wrong with my use of this function ? 

regards.
Alex.
_______________________________________________

http://openpgpjs.org

Reply via email to