Current location - Quotes Website - Signature design - Solve the problem of derinputstream.getlength (): Lengthtag =11,too big.
Solve the problem of derinputstream.getlength (): Lengthtag =11,too big.
The development of accessing Huawei's NB cloud platform requires jks.pkcs 12 digital signature public key and private key, and the key file is unified under project /resources/cert. The interface can be called locally, but the path cannot be found when the test environment is deployed, and then it is placed in the directory of src/main/resources, and then packaged and deployed to the specified directory of the test environment. Test the calling interface to load the signature, and the exception is as follows.

Derinputstream.getlength (): lengthtag =11,too big.

If it's okay to put the certificate in a separate file directory, do you think the path is too long?

The local test ruled out this possibility, and then the online search found that the exception was caused by the incorrect loading of the certificate, that is, the certificate was modified.

In order to confirm this situation, I replaced the certificate file in the war typed by maven, which is also the reason. Then why has the certificate been modified? It was maven-resources-plugin's fault.

Add the following configuration to pom.xml to filter certificate files with suffixes pkcs 12 and jks. If you load other files, you can add them yourself.