From d596b51b383321531654726a5124a88cdcd9cd79 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Fri, 7 Jun 2013 00:15:00 +0200 Subject: Also use friendly names when printing keystore certificate --HG-- extra : rebase_source : 4168ea0e489768c5fa2f5b54619d96e880e380c6 --- src/de/blinkt/openvpn/VpnProfile.java | 2 +- src/de/blinkt/openvpn/core/X509Utils.java | 38 ++++++++++++++++++------------- 2 files changed, 23 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/de/blinkt/openvpn/VpnProfile.java b/src/de/blinkt/openvpn/VpnProfile.java index 8b905a84..4c83bf81 100644 --- a/src/de/blinkt/openvpn/VpnProfile.java +++ b/src/de/blinkt/openvpn/VpnProfile.java @@ -574,7 +574,7 @@ public class VpnProfile implements Serializable{ OpenVPN.logMessage(0, "", context.getString(R.string.keychain_nocacert)); for(X509Certificate cert:cachain) { - OpenVPN.logInfo(R.string.cert_from_keystore,cert.getSubjectDN()); + OpenVPN.logInfo(R.string.cert_from_keystore,X509Utils.getCertificateFriendlyName(cert)); } diff --git a/src/de/blinkt/openvpn/core/X509Utils.java b/src/de/blinkt/openvpn/core/X509Utils.java index 0969069f..d07fcaee 100644 --- a/src/de/blinkt/openvpn/core/X509Utils.java +++ b/src/de/blinkt/openvpn/core/X509Utils.java @@ -48,22 +48,8 @@ public class X509Utils { if(!TextUtils.isEmpty(filename)) { try { X509Certificate cert = (X509Certificate) getCertificateFromFile(filename); - - X500Principal principal = (X500Principal) cert.getSubjectDN(); - - String friendlyname = principal.getName(); - System.out.println(friendlyname); - // Really evil hack to decode email address - - String[] parts = friendlyname.split(","); - for (int i=0;i