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

Side by Side Diff: sdk/lib/io/security_context.dart

Issue 1648793005: Adds SecurityContext.useCertificateChainBytes (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: *AsBytes -> *Bytes Created 4 years, 10 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart.io; 5 part of dart.io;
6 6
7 /** 7 /**
8 * The object containing the certificates to trust when making 8 * The object containing the certificates to trust when making
9 * a secure client connection, and the certificate chain and 9 * a secure client connection, and the certificate chain and
10 * private key to serve from a secure server. 10 * private key to serve from a secure server.
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 * must also have filesystem links added, which link extra filenames based 73 * must also have filesystem links added, which link extra filenames based
74 * on the hash of a certificate's distinguished name (DN) to the file 74 * on the hash of a certificate's distinguished name (DN) to the file
75 * containing that certificate. OpenSSL contains a tool called c_rehash 75 * containing that certificate. OpenSSL contains a tool called c_rehash
76 * to create these links in a directory. 76 * to create these links in a directory.
77 */ 77 */
78 void setTrustedCertificates({String file, String directory}); 78 void setTrustedCertificates({String file, String directory});
79 79
80 /** 80 /**
81 * Sets the chain of X509 certificates served by [SecureServer] 81 * Sets the chain of X509 certificates served by [SecureServer]
82 * when making secure connections, including the server certificate. 82 * when making secure connections, including the server certificate.
83 * [file] is an PEM file containing X509 certificates, starting with 83 *
84 * [file] is a PEM file containing X509 certificates, starting with
84 * the root authority and intermediate authorities forming the signed 85 * the root authority and intermediate authorities forming the signed
85 * chain to the server certificate, and ending with the server certificate. 86 * chain to the server certificate, and ending with the server certificate.
86 * The private key for the server certificate is set by [usePrivateKey]. 87 * The private key for the server certificate is set by [usePrivateKey].
88 *
89 * The function returns a [Future] that completes when the certificate chain
90 * has been set.
87 */ 91 */
88 void useCertificateChain(String file); 92 Future useCertificateChain(String file);
93
94 /**
95 * Sets the chain of X509 certificates served by [SecureServer]
96 * when making secure connections, including the server certificate.
97 *
98 * [chainBytes] is the contents of a PEM file containing X509 certificates,
99 * starting with the root authority and intermediate authorities forming the
100 * signed chain to the server certificate, and ending with the server
101 * certificate. The private key for the server certificate is set by
102 * [usePrivateKey].
103 */
104 void useCertificateChainAsBytes(List<int> chainBytes);
89 105
90 /** 106 /**
91 * Sets the list of authority names that a [SecureServer] will advertise 107 * Sets the list of authority names that a [SecureServer] will advertise
92 * as accepted, when requesting a client certificate from a connecting 108 * as accepted, when requesting a client certificate from a connecting
93 * client. [file] is a PEM file containing the accepted signing authority 109 * client. [file] is a PEM file containing the accepted signing authority
94 * certificates - the authority names are extracted from the certificates. 110 * certificates - the authority names are extracted from the certificates.
95 */ 111 */
96 void setClientAuthorities(String file); 112 void setClientAuthorities(String file);
97 113
98 /** 114 /**
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 } 216 }
201 217
202 if (bytes.length >= (1 << 13)) { 218 if (bytes.length >= (1 << 13)) {
203 throw new ArgumentError( 219 throw new ArgumentError(
204 'The maximum message length supported is 2^13-1.'); 220 'The maximum message length supported is 2^13-1.');
205 } 221 }
206 222
207 return new Uint8List.fromList(bytes); 223 return new Uint8List.fromList(bytes);
208 } 224 }
209 } 225 }
OLDNEW
« 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