Skip to content

Instantly share code, notes, and snippets.

@rnstux
Created April 7, 2016 18:52
Show Gist options
  • Save rnstux/ad66ec7ad3a560aac9edae069fb207f3 to your computer and use it in GitHub Desktop.
Save rnstux/ad66ec7ad3a560aac9edae069fb207f3 to your computer and use it in GitHub Desktop.
<?php
function sellar($txt){
$llave = "
-----BEGIN RSA PRIVATE KEY-----
-----END RSA PRIVATE KEY-----
";
$private = openssl_pkey_get_private($llave);
openssl_sign($txt, $sig, $private);
openssl_free_key($private);
return base64_encode($sig);
}
/*Ejemplo de uso */
print sellar("Prueba222");
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment