summaryrefslogtreecommitdiff
path: root/tests/NetworkSecurityConfigTest/src
diff options
context:
space:
mode:
authorChad Brubaker <cbrubaker@google.com>2015-11-25 13:12:55 -0800
committerChad Brubaker <cbrubaker@google.com>2015-12-01 12:19:39 -0800
commitfa9beebb83abe38fa04c14dc628bc5c1b4b068cd (patch)
treefffd0dd39998f8d115bc0f60fb431ac193929225 /tests/NetworkSecurityConfigTest/src
parent6fea66116c79ecb5232a1c7ae66ae2a6e62c1c12 (diff)
Expose findByIssuerAndSignature
This will be used to create a custom conscrypt TrustedCertificateStore to avoid loading all of the trusted certificates into memory in a keystore. Change-Id: Iaf54b691393ecadae6c7ff56b8adc6a2a2923d29
Diffstat (limited to 'tests/NetworkSecurityConfigTest/src')
-rw-r--r--tests/NetworkSecurityConfigTest/src/android/security/net/config/TestCertificateSource.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/NetworkSecurityConfigTest/src/android/security/net/config/TestCertificateSource.java b/tests/NetworkSecurityConfigTest/src/android/security/net/config/TestCertificateSource.java
index 69b2a9d55642..0c360631c294 100644
--- a/tests/NetworkSecurityConfigTest/src/android/security/net/config/TestCertificateSource.java
+++ b/tests/NetworkSecurityConfigTest/src/android/security/net/config/TestCertificateSource.java
@@ -44,4 +44,12 @@ public class TestCertificateSource implements CertificateSource {
}
return anchor.getTrustedCert();
}
+
+ public X509Certificate findByIssuerAndSignature(X509Certificate cert) {
+ java.security.cert.TrustAnchor anchor = mIndex.findByIssuerAndSignature(cert);
+ if (anchor == null) {
+ return null;
+ }
+ return anchor.getTrustedCert();
+ }
}