Andrei
Andrei

Reputation: 1203

PHP. PEAR. Crypt_RSA error

I need to create the keys, rsa signature for my data. Do for example on http://phpseclib.sourceforge.net/rsa/examples.html eventually see an error:

Deprecated: Assigning the return value of new by reference is deprecated in Z:\home\localhost\www\Crypt\RSA.php on line 228

what am I doing wrong?

Upvotes: 0

Views: 1184

Answers (3)

neubert
neubert

Reputation: 16792

What is your line 228? PEAR's Crypt_RSA's line 228 is this:

https://github.com/pear/Crypt_RSA/blob/master/Crypt/RSA.php#L228

That is indeed deprecated.

phpseclib's Crypt_RSA's line 228 has been a comment or a definition for quite a few versions:

My guess: you're using PEAR's Crypt_RSA and are confusing it for phpseclib's Crypt_RSA. They are not the same thing. PEAR's entire Crypt_RSA (not just a few lines within it but the entire package) is deprecated per pear.net:

http://pear.php.net/package/Crypt_RSA

Upvotes: 1

Andrei
Andrei

Reputation: 1203

Thank you all) I had to remove the RSA signature data. Refused Crypt_RSA chose for this purpose http://php.net/manual/en/function.openssl-sign.php

Upvotes: 1

cweiske
cweiske

Reputation: 31088

It's more a warning, not an error. The code does still work. Try changing your error_reporting level to not include E_DEPRECATED errors.

Upvotes: 1

Related Questions