first commit
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
// #########################################################
|
||||
// # PHP Signing #
|
||||
// #########################################################
|
||||
// Sample key. Replace with one used for CSR generation
|
||||
|
||||
$KEY = 'key.pem';
|
||||
|
||||
$req = $_REQUEST['req'];
|
||||
|
||||
$privateKey = openssl_get_privatekey(file_get_contents($KEY));
|
||||
|
||||
$signature = null;
|
||||
openssl_sign($req, $signature, $privateKey);
|
||||
|
||||
if ($signature) {
|
||||
header("Content-type: text/plain");
|
||||
echo base64_encode($signature);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
echo '<h1>Error signing message</h1>';
|
||||
exit(1);
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user