I want to take a public key .cer file generated from java keytool command like this:
"keytool -export -alias privatekey -file publickey.cer -keystore privateKeys.store"
and import it into a new, empty java keystore like this:
"keytool -import -alias publiccert -file publickey.cer -keystore publicCerts.store"
except I want to do the import programmatically, using JSSE.
Stack Overlords, work your magic! Thanks!
You cannot import the key into your trust store - you need a certificate for that. You can either ask for a certificate or write code to decrypt the bearer token with the public key directly.
Look at the KeyStore class in Java. Here is a class which might give you some hints. You might require the free BouncyCastle crypto provider to operate all of its function
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With