Php implements the signature. there is a pfx file provided by the Bank of China at hand, which is signed and passed to java for signature verification. please help me

Source: Internet
Author: User
Tags pkcs7 pfx file
Php implements the signature. there is a pfx file provided by the Bank of China on hand. it is signed and passed to java for signature verification. please help me. In the process, it seems useful to x509 and pkcs7. the signed string should be passed to java for signature verification. Methods I have tried: 1. read the private key in the pfx file using openssl_pkcs12_read, sign the php file with openssl_sign to implement the signature, and there is a pfx file provided by the Bank of China in hand, the signature is passed to java for signature verification. please help me.
In the process, it seems useful to x509 and pkcs7. the signed string should be passed to java for signature verification.
Methods I have tried:
1. use openssl_pkcs12_read to read the private key of the pfx file, use openssl_sign to sign the file, and use the signed data

Base64_encode for encoding conversion

2. convert the pfx file to pem and use openssl_pkcs7_sign to sign the file.

The signature made in the second method is familiar with the correct signature length and content, but there is no error found, so I am here to ask for help.

If you have signed a similar signature, please give us some advice or leave a contact information so that you can contact you privately.

------ Solution --------------------
Method 2.

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.