alphaland signing dep

This commit is contained in:
Astrologies 2021-12-17 06:08:39 -05:00
parent 1cfe9898ca
commit f86671d3dc
2 changed files with 20 additions and 0 deletions

View File

@ -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);
}
}
}

View File

@ -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();