new BigInteger($m, 256), 'publicExponent' => new BigInteger($e, 256), 'isPublicKey' => true, ]; } public static function savePublicKey(BigInteger $n, BigInteger $e, array $options = []): string { return 'RSA.' . Strings::base64UrlEncode($n->toBytes(), true) . '.' . Strings::base64UrlEncode($e->toBytes(), true); } }