From fa9beebb83abe38fa04c14dc628bc5c1b4b068cd Mon Sep 17 00:00:00 2001 From: Chad Brubaker Date: Wed, 25 Nov 2015 13:12:55 -0800 Subject: 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 --- .../src/android/security/net/config/TestCertificateSource.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests') 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(); + } } -- cgit v1.2.3-59-g8ed1b