static function crypt_rsa_key($mod, $exp, $hash = 'SHA256')
{
$rsa = new Crypt_RSA();
$rsa->setSignatureMode(CRYPT_RSA_SIGNATURE_PKCS1);
$rsa->setHash(strtolower($hash));
$rsa->modulus = new BigInteger($mod, 256);
$rsa->k = strlen($rsa->modulus->toBytes());
$rsa->exponent = new BigInteger($exp, 256);
$rsa->setPublicKey();
return $rsa;
}