Skip to content

Instantly share code, notes, and snippets.

@zbroyar
Created March 8, 2011 21:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zbroyar/861072 to your computer and use it in GitHub Desktop.
Save zbroyar/861072 to your computer and use it in GitHub Desktop.
Sign a message with OCaml Cryptokit sha256 & RSA
let (>>) x f = f x ;;
let hash = hash_string (Hash.sha256()) ;;
let sign_of_message key msg =
msg >> hash >>
(pkcs1v1pad key) >>
(RSA.sign key) >>
strrev
;;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment