I'm writing a chrome extension and I need to verify a file that I'll download through http to make sure it hasn't been tampered with. I don't mind if the message is intercepted and decrypted, I just need my extension to be sure the message came from me. https isn't an option for the file download but I figure this is just as good. The extension ships with the public key.
In javascript I would like to verify the file made with the openssl command below.
openssl rsautl -sign -inkey mykey.pem -out secret.txt.rsa -in secret.txt
Basically I want the javascript to do the same things as
openssl rsautl -verify -inkey pubkey.pem -in secret.txt.rsa -pubin
If that's not possible are there any good alternatives?
UPDATE: jsrsasign library worked perfectly. I ended up verifying a sha512 hash which is just as good.