Home > Article > Backend Development > keys generated by openssl_private_encrypt using DSA algorithm cannot be encrypted
openssl_private_encrypt($originalData, $encryptData, $privateKey, OPENSSL_ALGO_DSS1)
Warning message:
Warning: openssl_private_encrypt(): key type not supported in this PHP build!
Key: *.pem
-----BEGIN DSA PRIVATE KEY-----
密钥内容
-----END DSA PRIVATE KEY-----
It seems that this format of key is not supported for encryption. The content of this key is provided by the partner, and their development language is JAVA.
I use RSA formatted key contents and then encrypt using openssl_private_encrypt with no problem.
There is very little content related to PHP DSA encryption on the Internet, which is a headache.
openssl_private_encrypt($originalData, $encryptData, $privateKey, OPENSSL_ALGO_DSS1)
Warning message:
Warning: openssl_private_encrypt(): key type not supported in this PHP build!
Key: *.pem
-----BEGIN DSA PRIVATE KEY-----
密钥内容
-----END DSA PRIVATE KEY-----
It seems that this format of key is not supported for encryption. The content of this key is provided by the partner, and their development language is JAVA.
I use RSA formatted key contents and then encrypt using openssl_private_encrypt with no problem.
There is very little content related to PHP DSA encryption on the Internet, which is a headache.
Is privateKey pronounced correctly?