Commits

Anonymous committed 457f0f5 Merge

Merge "Move helper function to webkit"

Comments (0)

Files changed (1)

core/java/android/webkit/ClientCertRequestHandler.java

 import java.security.PrivateKey;
 import java.security.cert.CertificateEncodingException;
 import java.security.cert.X509Certificate;
-import com.android.org.conscrypt.NativeCrypto;
 import com.android.org.conscrypt.OpenSSLKey;
 import com.android.org.conscrypt.OpenSSLKeyHolder;
 
         mTable = table;
     }
 
+    private static byte[][] encodeCertificates(X509Certificate[] certificates)
+            throws CertificateEncodingException {
+        byte[][] certificateBytes = new byte[certificates.length][];
+        for (int i = 0; i < certificates.length; i++) {
+            certificateBytes[i] = certificates[i].getEncoded();
+        }
+        return certificateBytes;
+    }
+
     /**
      * Proceed with the specified private key and client certificate chain.
      */
     public void proceed(PrivateKey privateKey, X509Certificate[] chain) {
         try {
-            byte[][] chainBytes = NativeCrypto.encodeCertificates(chain);
+            byte[][] chainBytes = encodeCertificates(chain);
             mTable.Allow(mHostAndPort, privateKey, chainBytes);
 
             if (privateKey instanceof OpenSSLKeyHolder) {
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.