I am trying to generate a public key from the following x and y of a Q object in a browser. The problem is to use this public key to verify the JWT. I need to get the hexadecimal key format. I use keypair from src = "bitcoinjs.min.js", which does not allow me to get the hexadecimal form of the public key. Is there a library or function to convert it to hexadecimal?
var pubX = hdnode.keyPair.Q.x.toByteArrayUnsigned();
var pubY = hdnode.keyPair.Q.y.toByteArrayUnsigned();
var publicKeyBytes = pubX.concat(pubY);
publicKeyBytes.unshift(0x04);
meanwhile I tried
<script src="http://peterolson.github.com/BigInteger.js/BigInteger.min.js"></script>
var publicKeyInt = BigInt.fromByteArrayUnsigned(publicKeyBytes);
but it does not work Thanks in Advance
source
share