mirror of
https://github.com/owncloud/android-library.git
synced 2025-06-07 16:06:08 +00:00
OC-3163: Check if the certificate is in the app cetificates repository (mKnownServers of NetworkUtils)
This commit is contained in:
parent
cd4414a7bd
commit
b274963153
@ -172,5 +172,12 @@ public class NetworkUtils {
|
||||
return mConnManager;
|
||||
}
|
||||
|
||||
public static boolean isCertInKnownServersStore(Certificate cert, Context context) throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException {
|
||||
|
||||
KeyStore knownServers = getKnownServersStore(context);
|
||||
Log.d(TAG, "Certificate - HashCode: " + cert.hashCode() + " "
|
||||
+ Boolean.toString(knownServers.isCertificateEntry(Integer.toString(cert.hashCode()))));
|
||||
return knownServers.isCertificateEntry(Integer.toString(cert.hashCode()));
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user