How do I list and export a private key from a keystore?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A portion of code originally from Example Depot for listing all of the aliases in a key store:
The exporting of private keys came up on the Sun forums a couple of months ago, and u:turingcompleter came up with a DumpPrivateKey class to stitch into your app.
Note: this use Sun package, which is a ‘bad thing’.
If you can download apache commons code, here is a version which will compile without warning:
and will give the same result:
You can use it like so: