This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Security and the fly likes how do i use a PKCS12 file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Engineering » Security
Bookmark "how do i use a PKCS12 file" Watch "how do i use a PKCS12 file" New topic
Author

how do i use a PKCS12 file

O. Ziggy
Ranch Hand

Joined: Oct 02, 2005
Posts: 430

I've been sent a PKCS12 files but im not sure how to use it. Could someone please briefly explain to me what is and how i can use it.

I did some reading on public and private keys and was expecting two keys and a certificate to be sent to me but instead i recieved two files. A file of type P12 and a txt file with just a random number.

Does this file contain the public and private key + the certificat? To use it, do i need to import it into a keystore or is it itself a keystore?

Thanks
Freddy Wong
Ranch Hand

Joined: Sep 11, 2006
Posts: 959


Does this file contain the public and private key + the certificat?

Yes

To use it, do i need to import it into a keystore or is it itself a keystore?

PKCS12 itself is a keystore.


SCJP 5.0, SCWCD 1.4, SCBCD 1.3, SCDJWS 1.4
My Blog
Santhosh Kumar
Ranch Hand

Joined: Nov 07, 2000
Posts: 242
To read the pkcs12 file in Java, you need to specify the keystore type as "pkcs12". Here is the keytool command to print the certificate details.

 
Have you checked out Aspose?
 
subject: how do i use a PKCS12 file
 
It's not a secret anymore!