keys generated by openssl_private_encrypt using DSA algorithm cannot be encrypted

WBOY
Release: 2023-03-01 16:18:02
Original
1656 people have browsed it

<code>openssl_private_encrypt($originalData, $encryptData, $privateKey, OPENSSL_ALGO_DSS1)</code>
Copy after login
Copy after login

Warning message:

<code>Warning: openssl_private_encrypt(): key type not supported in this PHP build!
</code>
Copy after login
Copy after login

Key: *.pem

<code>-----BEGIN DSA PRIVATE KEY-----
密钥内容
-----END DSA PRIVATE KEY-----</code>
Copy after login
Copy after login

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.

Reply content:

<code>openssl_private_encrypt($originalData, $encryptData, $privateKey, OPENSSL_ALGO_DSS1)</code>
Copy after login
Copy after login

Warning message:

<code>Warning: openssl_private_encrypt(): key type not supported in this PHP build!
</code>
Copy after login
Copy after login

Key: *.pem

<code>-----BEGIN DSA PRIVATE KEY-----
密钥内容
-----END DSA PRIVATE KEY-----</code>
Copy after login
Copy after login

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?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template