java - How to get distinguished names from certificate using private key? -
my android app receive (by aidl
) user certificate , private key. how can distinguished name certificate?
the app sends certificate , private key can have these names keystore
initialized form *.pfx
file , using password this:
keystore keystore = keystore.getinstance("pkcs12"); keystore.load(in, getpassword().tochararray());
and using alias:
enumeration enumeration = clientkeystore.aliases(); while (enumeration.hasmoreelements()) { string currentalias = (string) enumeration.nextelement(); .. .. }
i can distinguished names
x509certificate c = (x509certificate) keystore.getcertificate(currentalias); principal subject = c.getsubjectdn(); string subjectarray[] = subject.tostring().split(","); (string s : subjectarray) { string[] str = s.trim().split("="); string key = str[0]; string value = str[1]; log.d(tag, key + " - " + value); }
i cannot pass more information app certificate , private key. how can reach same in app without password using cert , private key?
Comments
Post a Comment