Function to get only system-wide CA certificates added to TrustedCertificateManager
authorTobias Brunner <tobias@strongswan.org>
Mon, 13 Aug 2012 16:43:29 +0000 (18:43 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 14 Aug 2012 10:01:40 +0000 (12:01 +0200)
src/frontends/android/src/org/strongswan/android/logic/TrustedCertificateManager.java

index 74868dc..95fdecf 100644 (file)
@@ -191,6 +191,25 @@ public class TrustedCertificateManager
        }
 
        /**
+        * Get only the system-wide CA certificates.
+        * @return Hashtable mapping aliases to certificates
+        */
+       public Hashtable<String, X509Certificate> getSystemCACertificates()
+       {
+               Hashtable<String, X509Certificate> certs = new Hashtable<String, X509Certificate>();
+               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
         */