I am trying to get the SHA1 hash of my Telegram API public key so that I can authenticate with Telegram’s servers. Right now, I’m trying to concatenate two serialized strings of n
and e
from the certificate as described here.
Example of what I’m doing in NodeJS:
createHash("sha1").update(Buffer.concat([Buffer.from([254, 0, 1, 0]), b.subarray(9, 9 + 256), Buffer.from([3]), b.subarray(b.length - 3, b.length)])).digest("hex")
where b
is my base64-decoded certificate.