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

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

Issue 1616073004: Adds SecurityContext.usePrivateKeyBytes (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address comments Created 4 years, 11 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
« no previous file with comments | « sdk/lib/io/http.dart ('k') | tests/standalone/io/http_proxy_advanced_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/security_context.dart
diff --git a/sdk/lib/io/security_context.dart b/sdk/lib/io/security_context.dart
index 48e8111463be3a087fd4f6f71540f088ad08f490..5b666672845764e5949b0c25467292ce9708ec94 100644
--- a/sdk/lib/io/security_context.dart
+++ b/sdk/lib/io/security_context.dart
@@ -8,7 +8,7 @@ part of dart.io;
* The object containing the certificates to trust when making
* a secure client connection, and the certificate chain and
* private key to serve from a secure server.
- *
+ *
* The [SecureSocket] and [SecureServer] classes take a SecurityContext
* as an argument to their connect and bind methods.
*
@@ -35,13 +35,28 @@ abstract class SecurityContext {
/**
* Sets the private key for a server certificate or client certificate.
+ *
* A secure connection using this SecurityContext will use this key with
* the server or client certificate to sign and decrypt messages.
* [keyFile] is a PEM file containing an encrypted
* private key, encrypted with [password]. An unencrypted file can be
* used, but this is not usual.
+ *
+ * The function returns a [Future] that completes when the key has been added
+ * to the context.
+ */
+ Future usePrivateKey(String keyFile, {String password});
+
+ /**
+ * Sets the private key for a server certificate or client certificate.
+ *
+ * A secure connection using this SecurityContext will use this key with
+ * the server or client certificate to sign and decrypt messages.
+ * [keyBytes] is the contents of a PEM file containing an encrypted
+ * private key, encrypted with [password]. An unencrypted file can be
+ * used, but this is not usual.
*/
- void usePrivateKey(String keyFile, {String password});
+ void usePrivateKeyAsBytes(List<int> keyBytes, {String password});
/**
* Sets the set of trusted X509 certificates used by [SecureSocket]
« no previous file with comments | « sdk/lib/io/http.dart ('k') | tests/standalone/io/http_proxy_advanced_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698