Skip to content

Instantly share code, notes, and snippets.

Created September 2, 2013 08:26
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 anonymous/6410490 to your computer and use it in GitHub Desktop.
Save anonymous/6410490 to your computer and use it in GitHub Desktop.
$priKey = file_get_contents('../pem/rsa_private_key.pem');
$res = openssl_get_privatekey($priKey);
openssl_sign($data, $sign, $res);
//$sign为引用
openssl_free_key($res);
$sign = base64_encode($sign);
return $sign;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment