Home  >  Article  >  Backend Development  >  keys generated by openssl_private_encrypt using DSA algorithm cannot be encrypted

keys generated by openssl_private_encrypt using DSA algorithm cannot be encrypted

WBOY
WBOYOriginal
2016-12-01 00:25:301535browse

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.

Reply content:

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?

Statement:
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