From: Tobias Brunner Date: Mon, 13 Aug 2012 16:43:29 +0000 (+0200) Subject: Function to get only system-wide CA certificates added to TrustedCertificateManager X-Git-Tag: 5.0.1~202 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f075536ebed2126779b0b58b3dced51a0dae14e9;p=thirdparty%2Fstrongswan.git Function to get only system-wide CA certificates added to TrustedCertificateManager --- diff --git a/src/frontends/android/src/org/strongswan/android/logic/TrustedCertificateManager.java b/src/frontends/android/src/org/strongswan/android/logic/TrustedCertificateManager.java index 74868dc447..95fdecf14d 100644 --- a/src/frontends/android/src/org/strongswan/android/logic/TrustedCertificateManager.java +++ b/src/frontends/android/src/org/strongswan/android/logic/TrustedCertificateManager.java @@ -190,6 +190,25 @@ public class TrustedCertificateManager return certs; } + /** + * Get only the system-wide CA certificates. + * @return Hashtable mapping aliases to certificates + */ + public Hashtable getSystemCACertificates() + { + Hashtable certs = new Hashtable(); + this.mLock.readLock().lock(); + for (String alias : this.mCACerts.keySet()) + { + if (alias.startsWith("system:")) + { + certs.put(alias, this.mCACerts.get(alias)); + } + } + this.mLock.readLock().unlock(); + return certs; + } + /** * Get only the CA certificates installed by the user. * @return Hashtable mapping aliases to certificates