title: How can I create a Crypt::RSA object from modulus, exponent, and private exponent?
body: <p>I'm trying to port the following php functionality over to perl:</p>
  
  <pre><code>public function loadKey($mod, $exp, $type = 'public')
  {
      $rsa = new Crypt_RSA();
      $rsa-&gt;signatureMode = CRYPT_RSA_SIGNATURE_PKCS1;
      $rsa-&gt;setHash('sha256');
      $rsa-&gt;modulus = new Math_BigInteger(Magicsig::base64_url_decode($mod), 256);
      $rsa-&gt;k = strlen($rsa-&gt;modulus-&gt;toBytes());
      $rsa-&gt;exponent = new Math_BigInteger(Magicsig::base64_url_decode($exp), 256);
  
      // snip...
  }
  </code></pre>
  
  <p>I need to convert a string in the form ("RSA.$mod.$exp.$private_exp"):</p>
  
  <pre><code>RSA.mVgY8RN6URBTstndvmUUPb4UZTdwvwmddSKE5z_jvKUEK6yk1u3rrC9yN8k6FilGj9K0eeUPe2hf4Pj-5CmHww==.AQAB.Lgy_yL3hsLBngkFdDw1Jy9TmSRMiH6yihYetQ8jy-jZXdsZXd8V5ub3kuBHHk4M39i3TduIkcrjcsiWQb77D8Q==
  </code></pre>
  
  <p>...to a Crypt::RSA object. I've split out the components so I have $mod, $exp, and $private_exp, but the perl Crypt::RSA API doesn't seem to have a way to explicitly set.</p>