todvora / eet-client

Client and library for #EET communication - http://www.etrzby.cz/ , written in Java
MIT License
47 stars 26 forks source link

reading keystore.p12 sometimes read not keyEntry as a first alias #6

Closed marek-veber closed 7 years ago

marek-veber commented 7 years ago

the code:

final Enumeration<String> aliases = getAliases(keystore);

returns aliases of two types:

keystore.isKeyEntry(a) == true

and

keystore.isCertificateEntry(a) == true

But using method select first one can be randomly unvanted CertificateEntry (not required KeyEntry) ;)

So, sometimes initialisation fails with an error such as "bad key format", while using certificate as a key ;(

todvora commented 7 years ago

Merged, thank you for your contribution!