(using openpgp1.2/openpgpjs-master/dist/openpgp.js)
var openpgp = window.openpgp;
var testPublicKey = sessionStorage.getItem('testPublicKey');
var pubkey = openpgp.key.readArmored(testPublicKey).keys;
var getFingerprint = function (key) {
return openpgp.key.primaryKey.fingerprint;
};
console.log(getFingerprint(pubkey));
// this returns: TypeError: openpgp.key.primaryKey is undefined
// if I do console.log(openpgp.key);
//this returns: Object { Key: Key(), readArmored: readArmored(), generate:
generate(), getPreferredSymAlgo: getPreferredSymAlgo() }
any suggestions?
On Sun, Dec 13, 2015 at 6:14 AM, Tio Oscar <[email protected]> wrote:
> var getFingerprint = function (key) {
> return key.primaryKey.fingerprint;
> };
>
> El sáb., 12 de dic. de 2015 a la(s) 13:03, Andrew <[email protected]>
> escribió:
>
>> There are two functions in public_key.js - getFingerprint()
>> and getKeyId().
>> I would like to run the public key through both these functions, any idea
>> how?
>>
>> thanks.
>> _______________________________________________
>>
>> http://openpgpjs.org
>> Subscribe/unsubscribe: http://list.openpgpjs.org
>
>
> _______________________________________________
>
> http://openpgpjs.org
> Subscribe/unsubscribe: http://list.openpgpjs.org
>
_______________________________________________
http://openpgpjs.org
Subscribe/unsubscribe: http://list.openpgpjs.org