Function to get only system-wide CA certificates added to TrustedCertificateManager

This commit is contained in:
Tobias Brunner
2012-08-14 12:01:40 +02:00
parent 2dc8998419
commit f075536ebe
@@ -190,6 +190,25 @@ public class TrustedCertificateManager
return certs;
}
/**
* 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