Sample Code - Vayana Auth Token Generation - PHP

$txnId = "INVO".$timeStamp.rand(100,999);
$private_key = file_get_contents('my/myprivatekey');
$public_key = file_get_contents('my/publickey.txt');
define ('ALGO', 'SHA256');
// Sign Auth sting
function sign_auth_string($data, $private_key) {
    openssl_sign($data, $signature, $private_key, ALGO);
    return base64_encode($signature);
}
// Verfiy Sign Auth sting
function verfiy_sign_auth_string($data, $signature, $pubkeyid) {
    $signature = base64_decode($signature);
    $verify = openssl_verify($data, $signature, $pubkeyid, ALGO);
    return $verify;
}
// auth string = ClientID:Txn ID:Timestamp:GSTIN update with ur credentials
$auth_string = ClientID:Txn ID:Timestamp:GSTIN;
// X-Asp-Auth-Token : auth string
echo $xAspAuthToken = $auth_string;
// Sign Auth String / X-Asp-Auth-Signature
echo "Sign Auth String:\n";
echo $xAspAuthSignature = $signAuthString = sign_auth_string($auth_string,
$private_key);
// Verify Auth String Sign
echo verfiy_sign_auth_string($auth_string, $signAuthString, $public_key);