How to use the phpopenssl_pkcs7_sign () function

Source: Internet
Author: User
How to use the phpopenssl_pkcs7_sign () function to sign data, openssl_pkcs7_sign () is used, but what I see on the Internet is an English explanation, which is helpless. 1. here I have a certificate in pfx format, but I don't know if it can be used. 2. when using this function, the following error occurs: how to use the php openssl_pkcs7_sign () function?
Openssl_pkcs7_sign () is used to sign the data. However, what I see on the Internet is an English explanation, which is helpless.
1. here I have a certificate in pfx format, but I don't know if it can be used.
2. during use, this function reports the error: openssl_pkcs7_sign () [function. openssl-pkcs7-sign]: error getting private key

Thank you! Online...
------ Solution --------------------
I am also waiting for the arrival of experts with the landlord!
------ Solution --------------------
. PFX-same as. p12
. P12-PKCS #12 file, including the certificate (public key) and private key (password-protected), has a complete certificate chain letter.

Your pfx is PKCS #12, not PKCS #7. You cannot use pkcs7 directly.

------ Solution --------------------
Reference:
. PFX-same as. p12
. P12-PKCS #12 file, including the certificate (public key) and private key (password-protected), has a complete certificate chain letter.

Your pfx is PKCS #12, not PKCS #7. You cannot use pkcs7 directly.


What should pfx do? I now use openssl to convert pfx to pem format. I use many openssl_pkcs7_sign () formats only for pem, and errors will be reported for others. However, the signature result I got is not consistent with the actual result.
------ Solution --------------------
I finally solved the problem and wanted to know the result. I have uploaded the document to csdn. You can download ([PDF file] Bank of China online banking payment signature)
------ Solution --------------------
What should I do if I have no score?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.