Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Unified Diff: sdk/lib/io/secure_socket.dart

Issue 21716004: dart:io | Add SecureSocket.importPrivateCertificates, that reads a PKCS#12 file. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add more API functions, tests Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sdk/lib/io/secure_socket.dart
diff --git a/sdk/lib/io/secure_socket.dart b/sdk/lib/io/secure_socket.dart
index 2fd9659bc5d27c3c0ecc844dbdd7fc5a20e00a04..3f1f8cf663146f74d0667a3f8d3324ac291643b0 100644
--- a/sdk/lib/io/secure_socket.dart
+++ b/sdk/lib/io/secure_socket.dart
@@ -205,7 +205,8 @@ abstract class SecureSocket implements Socket {
*/
external static void initialize({String database,
String password,
- bool useBuiltinRoots: true});
+ bool useBuiltinRoots: true,
+ bool readOnly: true});
/**
@@ -240,6 +241,33 @@ abstract class SecureSocket implements Socket {
*/
external static X509Certificate addCertificate(List<int> certificate,
String trust);
+
+
+ /**
+ * Adds a X509 certificates (for SSL and TLS secure networking) with
+ * their private keys to the in-memory certificate database.
+ *
+ * [certificates] must be a list of bytes encoding a PKCS#12 encoded
+ * list of certificates and private keys. These are commonly called
+ * .pk files.
+ *
+ * All certificates are imported with no default trust, and the appropriate
+ * uses of each certificate must be added with SecureSocket.changeTrust.
+ *
+ * See the documentation of NSS certutil at
+ * http://developer.mozilla.org/en-US/docs/NSS_reference/NSS_tools_:_certutil
+ * or
+ * http://blogs.oracle.com/meena/entry/notes_about_trust_flags
+ * for more information about trust attributes.
+ */
+ external static importPrivateCertificates(List<int> certificates,
+ String password);
+
+
+ external static X509Certificate changeTrust(String nicknameOrDN,
+ String trust);
+
+ external static removeCertificate(String nicknameOrDN);
}

Powered by Google App Engine
This is Rietveld 408576698