phpseclib: Cannot instantiate abstract class 'RSA'

$key = new RSA();
if (!$key->load($raw)) {
    return false;   // Not an unencrypted RSA key.
}

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 21 (12 by maintainers)

Commits related to this issue

Most upvoted comments

You’re trying to use phpseclib 2’s API with phpseclib 3. That won’t work unless you use https://github.com/phpseclib/phpseclib2_compat

To do this with phpseclib 3 you need to do it this way:

use phpseclib3\Crypt\PublicKeyLoader;

$key = PublicKeyLoader::load($raw);