alphaland signing dep
This commit is contained in:
parent
1cfe9898ca
commit
f86671d3dc
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
|
||||
namespace Alphaland\Common {
|
||||
|
||||
class Signing
|
||||
{
|
||||
public static function SignData(string $data, bool $rbxsig=true)
|
||||
{
|
||||
$sig = "";
|
||||
$key = "-----BEGIN RSA PRIVATE KEY-----\n" . wordwrap(file_get_contents($GLOBALS['privateKeyPath']), 64, "\n",true) . "\n-----END RSA PRIVATE KEY-----\n";
|
||||
openssl_sign($data, $sig, $key, OPENSSL_ALGO_SHA1);
|
||||
|
||||
if ($rbxsig) {
|
||||
return "--rbxsig%" . base64_encode($sig) . "%" . $data;
|
||||
}
|
||||
return base64_encode($sig);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -111,6 +111,7 @@ try
|
|||
include "C:/Webserver/nginx/Alphaland/globals/Dependencies/Assets/Render.php";
|
||||
include "C:/Webserver/nginx/Alphaland/globals/Dependencies/UI/ImageHelper.php";
|
||||
include "C:/Webserver/nginx/Alphaland/globals/Dependencies/Users/Render.php";
|
||||
include "C:/Webserver/nginx/Alphaland/globals/Dependencies/Common/Signing.php";
|
||||
|
||||
//authenticator
|
||||
$authenticator = new PHPGangsta_GoogleAuthenticator();
|
||||
|
|
|
|||
Loading…
Reference in New Issue