Index: sdk/lib/io/secure_socket.dart |
diff --git a/sdk/lib/io/secure_socket.dart b/sdk/lib/io/secure_socket.dart |
index 18670502cf2c448ff7392687bc1ce014cba92d44..44f2cff20c3012551545984870464964a79c3741 100644 |
--- a/sdk/lib/io/secure_socket.dart |
+++ b/sdk/lib/io/secure_socket.dart |
@@ -205,6 +205,26 @@ abstract class SecureSocket implements Socket { |
external static void initialize({String database, |
String password, |
bool useBuiltinRoots: true}); |
+ |
+ |
+ /** |
+ * Adds a X509 certificate (for SSL and TLS secure networking) to the |
+ * in-memory certificate database. Returns an X509Certificate object |
+ * with information about the added certificate. |
+ * |
+ * [certificate] must be a list of bytes encoding a certificate in |
+ * PEM format: a base64 encoded DER certificate, enclosed between |
+ * "-----BEGIN CERTIFICATE-----" and "-----END CERTIFICATE-----". |
+ * |
+ * [trust] is a string specifying the allowed uses of this certificate. |
+ * For example, 'TC,,' specifies that the certificate is for a certificate |
Søren Gjesse
2013/07/29 14:12:19
Could we add some string constants (with dartdoc)
Bill Hesse
2013/07/30 10:00:10
Done.
|
+ * authority that is trusted to issue server and client certificates, so |
+ * that a server or client certificate signed by this authority will be |
+ * accepted. |
+ * See the documentation of NSS certutil for more about trust attributes. |
Søren Gjesse
2013/07/29 14:12:19
Can we add a URL here?
Bill Hesse
2013/07/30 10:00:10
Done.
|
+ */ |
+ external static X509Certificate addCertificate(List<int> certificate, |
+ String trust); |
} |
@@ -412,7 +432,8 @@ class _RawSecureSocket extends Stream<RawSocketEvent> |
static final int NUM_BUFFERS = 4; |
// Is a buffer identifier for an encrypted buffer? |
- static bool _isBufferEncrypted(int identifier) => identifier >= READ_ENCRYPTED; |
+ static bool _isBufferEncrypted(int identifier) => |
+ identifier >= READ_ENCRYPTED; |
RawSocket _socket; |
final Completer<_RawSecureSocket> _handshakeComplete = |