简体   繁体   中英

Java Security with KeyStore and public certificates aliases

I'm facing a problem with java security in keystore aliases.

My problem is that we are getting keystore aliases from a browser but when we get the list sometimes two .pfx certificates have the same alias because they are both for the same company but one is for signin and other is for encryption. This means that when we try to differentiate uniquely it fails because the keystore.aliases method returns the same for both aliases so it can't tell which to return.

For signing you will need a PrivateKey entry. Encryption you only need the recipients PublicKey . If you examine the Keystore entry type you should be able to tell which is which.

If you can only compare the certificates you will need to look at the X509 cert usage and see if that helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM