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

Side by Side Diff: runtime/bin/secure_socket_patch.dart

Issue 1616073004: Adds SecurityContext.usePrivateKeyBytes (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 patch class SecureSocket { 5 patch class SecureSocket {
6 /* patch */ factory SecureSocket._(RawSecureSocket rawSocket) => 6 /* patch */ factory SecureSocket._(RawSecureSocket rawSocket) =>
7 new _SecureSocket(rawSocket); 7 new _SecureSocket(rawSocket);
8 } 8 }
9 9
10 10
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 _SecurityContext() { 131 _SecurityContext() {
132 _createNativeContext(); 132 _createNativeContext();
133 } 133 }
134 134
135 void _createNativeContext() native "SecurityContext_Allocate"; 135 void _createNativeContext() native "SecurityContext_Allocate";
136 136
137 static final SecurityContext defaultContext = 137 static final SecurityContext defaultContext =
138 new _SecurityContext().._trustBuiltinRoots(); 138 new _SecurityContext().._trustBuiltinRoots();
139 139
140 void usePrivateKey(String keyFile, {String password}) 140 void usePrivateKey(String keyFile, {String password})
141 native "SecurityContext_UsePrivateKey"; 141 native "SecurityContext_UsePrivateKey";
142 void usePrivateKeyBytes(List<int> keyBytes, {String password})
143 native "SecurityContext_UsePrivateKeyBytes";
142 void setTrustedCertificates({String file, String directory}) 144 void setTrustedCertificates({String file, String directory})
143 native "SecurityContext_SetTrustedCertificates"; 145 native "SecurityContext_SetTrustedCertificates";
144 void useCertificateChain(String file) 146 void useCertificateChain(String file)
145 native "SecurityContext_UseCertificateChain"; 147 native "SecurityContext_UseCertificateChain";
146 void setClientAuthorities(String file) 148 void setClientAuthorities(String file)
147 native "SecurityContext_SetClientAuthorities"; 149 native "SecurityContext_SetClientAuthorities";
148 void setAlpnProtocols(List<String> protocols, bool isServer) { 150 void setAlpnProtocols(List<String> protocols, bool isServer) {
149 Uint8List encodedProtocols = 151 Uint8List encodedProtocols =
150 SecurityContext._protocolsToLengthEncoding(protocols); 152 SecurityContext._protocolsToLengthEncoding(protocols);
151 _setAlpnProtocols(encodedProtocols, isServer); 153 _setAlpnProtocols(encodedProtocols, isServer);
(...skipping 19 matching lines...) Expand all
171 DateTime get startValidity { 173 DateTime get startValidity {
172 return new DateTime.fromMillisecondsSinceEpoch(_startValidity(), 174 return new DateTime.fromMillisecondsSinceEpoch(_startValidity(),
173 isUtc: true); 175 isUtc: true);
174 } 176 }
175 DateTime get endValidity { 177 DateTime get endValidity {
176 return new DateTime.fromMillisecondsSinceEpoch(_endValidity(), 178 return new DateTime.fromMillisecondsSinceEpoch(_endValidity(),
177 isUtc: true); 179 isUtc: true);
178 } 180 }
179 int _startValidity() native "X509_StartValidity"; 181 int _startValidity() native "X509_StartValidity";
180 int _endValidity() native "X509_EndValidity"; 182 int _endValidity() native "X509_EndValidity";
181 } 183 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698