summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2013-08-09 11:08:41 +0200
committerArne Schwabe <arne@rfc2549.org>2013-08-09 11:08:41 +0200
commitc5bd9f110c84f0d3b0a29295337cf724eb2bdbfb (patch)
treed46d69b6592999f9da447881ad8d1aa1437f1f19 /src
parentf7afba629cfb1e40daf32fb25801c562e113d084 (diff)
Guess if a certificate is stored in hardware
Diffstat (limited to 'src')
-rw-r--r--src/de/blinkt/openvpn/fragments/Settings_Basic.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/de/blinkt/openvpn/fragments/Settings_Basic.java b/src/de/blinkt/openvpn/fragments/Settings_Basic.java
index 28c2ca38..a93cc833 100644
--- a/src/de/blinkt/openvpn/fragments/Settings_Basic.java
+++ b/src/de/blinkt/openvpn/fragments/Settings_Basic.java
@@ -6,6 +6,7 @@ import android.app.AlertDialog.Builder;
import android.app.Fragment;
import android.content.ActivityNotFoundException;
import android.content.Intent;
+import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Handler.Callback;
@@ -82,12 +83,17 @@ public class Settings_Basic extends Fragment implements View.OnClickListener, On
{
new Thread() {
public void run() {
- String certstr;
+ String certstr="";
try {
+ X509Certificate cert = KeyChain.getCertificateChain(getActivity(), mProfile.mAlias)[0];
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
+ String algorithm= KeyChain.getPrivateKey(getActivity(),mProfile.mAlias).getAlgorithm();
+ if (KeyChain.isBoundKeyAlgorithm(algorithm))
+ certstr+=getString(R.string.hwkeychain);
+ }
- X509Certificate cert = KeyChain.getCertificateChain(getActivity(), mProfile.mAlias)[0];
- certstr=X509Utils.getCertificateFriendlyName(cert);
+ certstr+=X509Utils.getCertificateFriendlyName(cert);
} catch (Exception e) {
certstr="Could not get certificate from Keystore";
}