How to sign data with .p12 file in Java?

How to sign data with .p12 file in Java?

Java seems to only support up to pkcs11, I just can't find the standard library for pkcs12. There is nothing in java.security ... for decoding a .p12 file to get the secret key for signing.

Any solution? I am creating an applet, so it’s good if there is a small library, but not those libraries that are 1 MB or larger.

+6
source share
2 answers

You can open the p12 file as a keystore.

http://docs.oracle.com/javase/6/docs/technotes/guides/security/jsse/JSSERefGuide.html#KeystoreFormats

After opening the keystore, you can get the private key and use it to sign your data.

+4
source

I published a clean working solution for using .p12 / pkcs12 certificates in Java in another fooobar.com/questions/426977 / ....

-1
source

Source: https://habr.com/ru/post/902933/


All Articles