- Code: Select all
$rsa = new Crypt_RSA( );
$rsa->loadKey( array( 'n' => new Math_BigInteger( 'modulus hex string', 16 ),
'e' => new Math_BigInteger( 'pub exponent', 16 ) ),
CRYPT_RSA_PUBLIC_FORMAT_RAW );
and I can encrypt using the key. However, I'd also like to be able to print out the public key in PKCS1 format, but when I try, getPublicKey() returns false. After investigating, it appears that loadKey moves ['publicExponent'] to ['exponent'] and sets ['publicExponent'] to false (RSA.php:1193).
Why is that?
