Home >Backend Development >PHP Tutorial >keys generated by openssl_private_encrypt using DSA algorithm cannot be encrypted
<code>openssl_private_encrypt($originalData, $encryptData, $privateKey, OPENSSL_ALGO_DSS1)</code>
Warning message:
<code>Warning: openssl_private_encrypt(): key type not supported in this PHP build! </code>
Key: *.pem
<code>-----BEGIN DSA PRIVATE KEY----- 密钥内容 -----END DSA PRIVATE KEY-----</code>
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.
<code>openssl_private_encrypt($originalData, $encryptData, $privateKey, OPENSSL_ALGO_DSS1)</code>
Warning message:
<code>Warning: openssl_private_encrypt(): key type not supported in this PHP build! </code>
Key: *.pem
<code>-----BEGIN DSA PRIVATE KEY----- 密钥内容 -----END DSA PRIVATE KEY-----</code>
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?