There is not docunented, but there are a method called toHex:
Keyid.prototype.toHex = function() { return util.hexstrdump(this.bytes);};
In your case:
console.log(pgpMessage.packets[0].publicKeyId.toHex() );
El jue., 17 de dic. de 2015 a la(s) 18:03, Andrew <[email protected]>
escribió:
> I am trying to get the publicKeyId from the encrypted message.
>
> pgpMessage = openpgp.message.readArmored(pgpMessage);
>
> console.log( JSON.stringify( pgpMessage ) )
> returns:
>
>
> {"packets":{"0":{"tag":1,"version":3,"publicKeyId":{"bytes":"ošãï{m¹È"},"publicKeyAlgorithm":"rsa_encrypt_sign","sessionKey":null,"sessionKeyAlgorithm":"aes256","encrypted":[{"data":
>
> console.log( JSON.stringify(
> pgpMessage['packets'][0]['publicKeyId']['bytes'] ) );
> returns:
>
> "ošãï{m¹È"
>
> does this - "bytes" represent the publicKeyId and if so how do I convert
> it into a format that I can compare with the actual publicKeyId associated
> with the publicKey used for encryption?
>
> thanks.
>
> _______________________________________________
>
> http://openpgpjs.org
> Subscribe/unsubscribe: http://list.openpgpjs.org
_______________________________________________
http://openpgpjs.org
Subscribe/unsubscribe: http://list.openpgpjs.org