Skip to content

Instantly share code, notes, and snippets.

@tsloughter
Created January 1, 2017 03:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsloughter/4fd5d7c0555dcb816e5d8273e70375a8 to your computer and use it in GitHub Desktop.
Save tsloughter/4fd5d7c0555dcb816e5d8273e70375a8 to your computer and use it in GitHub Desktop.
{ok, {{_, 200, _}, _, Signature}} = httpc:request(get, {Url, [{"User-Agent", rebar_utils:user_agent()}]}, [], [{sync, true}], rebar),
{ok, Data} = file:read_file(TmpFile),
[RsaPublicKey] = public_key:pem_decode(?PUBLIC_KEY),
Key = public_key:pem_entry_decode(RsaPublicKey),
public_key:verify(Data, sha512, Signature, Key)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment