Hi Sean,
Thanks for answering.
There would be a way to map a private key to a public key using the keys
IDs if *openpgp.generateKeyPair(...)* returned {*privateKey:
[openpgp_msg_privatekey],*
*privateKeyArmored: [string],*
*publicKey: [openpgp_msg_privatekey],
*
*publicKeyArmored: [string]}*
*
*
Thus, when I generate my key pair, I can store a couple of key IDs, and I
know which public key goes with which private key.
var myKeyPair = generate_key_pair(1, 2048, userId);
var myObj = {
privKeyId: myKeyPair.privateKey.getKeyId(),
pubKeyId: myKeyPair.publicKey.getKeyId(),
...
}
chrome.storageArea.set(myObj,function(){...});
Unfortunately, at the moment *openpgp.generateKeyPair(...)* returns only
{*privateKey: [openpgp_msg_privatekey],*
*privateKeyArmored: [string],*
*publicKeyArmored: [string]}*
Would it be possible ? Or is there a good reason for generateKeyPair not
returning the public key ?
Regards
2013/5/13 Sean Colyer <[email protected]>
> Yes, this could be an issue.
>
> If you knew what id you wanted to use you could call
> the getPublicKeysForKeyId()/getPrivateKeyForKeyId() functions. Looking up
> by address is pretty common in most openpgp.js implementations, because we
> don't know the key ID we're looking for but do know the email address.
>
> Sean
>
>
> On Sun, May 12, 2013 at 12:13 PM, emma sculateur
> <[email protected]>wrote:
>
>> Hi all,
>>
>> First of all, thanks for openpgpjs :)
>>
>> I have a question :
>>
>> If [email protected] generates a 2 or more key pairs. I can get the keys
>> with :
>> var privateKeys = getPrivateKeyForAddress([email protected]);
>> var publicKeys = getPublicKeyForAddress([email protected]);
>>
>> But am I sure sur privateKeys[i] is associated with publicKeys[i] ?
>> How do you handle the cases where there are several pair associated to
>> the same email address ?
>>
>> Thank you in advance.
>>
>> _______________________________________________
>>
>> http://openpgpjs.org
>>
>>
>
> _______________________________________________
>
> http://openpgpjs.org
>
>
_______________________________________________
http://openpgpjs.org