OLD | NEW |
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 /** | 50 /** |
51 * Sets the private key for a server certificate or client certificate. | 51 * Sets the private key for a server certificate or client certificate. |
52 * | 52 * |
53 * A secure connection using this SecurityContext will use this key with | 53 * A secure connection using this SecurityContext will use this key with |
54 * the server or client certificate to sign and decrypt messages. | 54 * the server or client certificate to sign and decrypt messages. |
55 * [keyBytes] is the contents of a PEM file containing an encrypted | 55 * [keyBytes] is the contents of a PEM file containing an encrypted |
56 * private key, encrypted with [password]. An unencrypted file can be | 56 * private key, encrypted with [password]. An unencrypted file can be |
57 * used, but this is not usual. | 57 * used, but this is not usual. |
58 */ | 58 */ |
59 void usePrivateKeyAsBytes(List<int> keyBytes, {String password}); | 59 void usePrivateKeyBytes(List<int> keyBytes, {String password}); |
60 | 60 |
61 /** | 61 /** |
62 * Sets the set of trusted X509 certificates used by [SecureSocket] | 62 * Sets the set of trusted X509 certificates used by [SecureSocket] |
63 * client connections, when connecting to a secure server. | 63 * client connections, when connecting to a secure server. |
64 * | 64 * |
65 * There are two ways to set a set of trusted certificates, with a single | 65 * There are two ways to set a set of trusted certificates, with a single |
66 * PEM file, or with a directory containing individual PEM files for | 66 * PEM file, or with a directory containing individual PEM files for |
67 * certificates. | 67 * certificates. |
68 * | 68 * |
69 * [file] is an optional PEM file containing X509 certificates, usually | 69 * [file] is an optional PEM file containing X509 certificates, usually |
(...skipping 24 matching lines...) Expand all Loading... |
94 /** | 94 /** |
95 * Sets the chain of X509 certificates served by [SecureServer] | 95 * Sets the chain of X509 certificates served by [SecureServer] |
96 * when making secure connections, including the server certificate. | 96 * when making secure connections, including the server certificate. |
97 * | 97 * |
98 * [chainBytes] is the contents of a PEM file containing X509 certificates, | 98 * [chainBytes] is the contents of a PEM file containing X509 certificates, |
99 * starting with the root authority and intermediate authorities forming the | 99 * starting with the root authority and intermediate authorities forming the |
100 * signed chain to the server certificate, and ending with the server | 100 * signed chain to the server certificate, and ending with the server |
101 * certificate. The private key for the server certificate is set by | 101 * certificate. The private key for the server certificate is set by |
102 * [usePrivateKey]. | 102 * [usePrivateKey]. |
103 */ | 103 */ |
104 void useCertificateChainAsBytes(List<int> chainBytes); | 104 void useCertificateChainBytes(List<int> chainBytes); |
105 | 105 |
106 /** | 106 /** |
107 * Sets the list of authority names that a [SecureServer] will advertise | 107 * Sets the list of authority names that a [SecureServer] will advertise |
108 * as accepted, when requesting a client certificate from a connecting | 108 * as accepted, when requesting a client certificate from a connecting |
109 * client. [file] is a PEM file containing the accepted signing authority | 109 * client. [file] is a PEM file containing the accepted signing authority |
110 * certificates - the authority names are extracted from the certificates. | 110 * certificates - the authority names are extracted from the certificates. |
111 */ | 111 */ |
112 void setClientAuthorities(String file); | 112 void setClientAuthorities(String file); |
113 | 113 |
114 /** | 114 /** |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 } | 216 } |
217 | 217 |
218 if (bytes.length >= (1 << 13)) { | 218 if (bytes.length >= (1 << 13)) { |
219 throw new ArgumentError( | 219 throw new ArgumentError( |
220 'The maximum message length supported is 2^13-1.'); | 220 'The maximum message length supported is 2^13-1.'); |
221 } | 221 } |
222 | 222 |
223 return new Uint8List.fromList(bytes); | 223 return new Uint8List.fromList(bytes); |
224 } | 224 } |
225 } | 225 } |
OLD | NEW |