OpenPGP_Crypt_RSA::crypt_rsa_key PHP Method

crypt_rsa_key() static public method

static public crypt_rsa_key ( $mod, $exp, $hash = 'SHA256' )
    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;
    }