rename importClientCertificate => importCertificate
This commit is contained in:
parent
2d8286515d
commit
794d120754
4 changed files with 20 additions and 8 deletions
|
@ -167,7 +167,7 @@ int ImportIntoCertStore(
|
||||||
base::string16 password;
|
base::string16 password;
|
||||||
net::CertificateList imported_certs;
|
net::CertificateList imported_certs;
|
||||||
int rv = -1;
|
int rv = -1;
|
||||||
options.GetString("clientCertificate", &cert_path);
|
options.GetString("certificate", &cert_path);
|
||||||
options.GetString("password", &password);
|
options.GetString("password", &password);
|
||||||
|
|
||||||
if (!cert_path.empty()) {
|
if (!cert_path.empty()) {
|
||||||
|
@ -405,7 +405,7 @@ bool App::MakeSingleInstance(
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(USE_NSS_CERTS)
|
#if defined(USE_NSS_CERTS)
|
||||||
void App::ImportClientCertificate(
|
void App::ImportCertificate(
|
||||||
const base::DictionaryValue& options,
|
const base::DictionaryValue& options,
|
||||||
const net::CompletionCallback& callback) {
|
const net::CompletionCallback& callback) {
|
||||||
auto browser_context = AtomBrowserMainParts::Get()->browser_context();
|
auto browser_context = AtomBrowserMainParts::Get()->browser_context();
|
||||||
|
@ -474,7 +474,7 @@ mate::ObjectTemplateBuilder App::GetObjectTemplateBuilder(
|
||||||
&App::AllowNTLMCredentialsForAllDomains)
|
&App::AllowNTLMCredentialsForAllDomains)
|
||||||
.SetMethod("getLocale", &App::GetLocale)
|
.SetMethod("getLocale", &App::GetLocale)
|
||||||
#if defined(USE_NSS_CERTS)
|
#if defined(USE_NSS_CERTS)
|
||||||
.SetMethod("importClientCertificate", &App::ImportClientCertificate)
|
.SetMethod("importCertificate", &App::ImportCertificate)
|
||||||
#endif
|
#endif
|
||||||
.SetMethod("makeSingleInstance", &App::MakeSingleInstance);
|
.SetMethod("makeSingleInstance", &App::MakeSingleInstance);
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,8 +111,8 @@ class App : public AtomBrowserClient::Delegate,
|
||||||
std::string GetLocale();
|
std::string GetLocale();
|
||||||
|
|
||||||
#if defined(USE_NSS_CERTS)
|
#if defined(USE_NSS_CERTS)
|
||||||
void ImportClientCertificate(const base::DictionaryValue& options,
|
void ImportCertificate(const base::DictionaryValue& options,
|
||||||
const net::CompletionCallback& callback);
|
const net::CompletionCallback& callback);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
|
|
|
@ -514,6 +514,18 @@ if (browserOptions.transparent) {
|
||||||
|
|
||||||
This method returns `true` if the system is in Dark Mode, and `false` otherwise.
|
This method returns `true` if the system is in Dark Mode, and `false` otherwise.
|
||||||
|
|
||||||
|
### `app.importCertificate(options, callback)` _LINUX_
|
||||||
|
|
||||||
|
* `options` Object
|
||||||
|
* `certificate` String - Path for the pkcs12 file.
|
||||||
|
* `password` String - Passphrase for the certificate.
|
||||||
|
* `callback` Function
|
||||||
|
* `result` Integer - Result of import.
|
||||||
|
|
||||||
|
Imports the certificate in pkcs12 format into the platform certificate store.
|
||||||
|
`callback` is called with the `result` of import operation, a value of `0` indicates
|
||||||
|
success while any other value indicates failure according to chromium [net_error_list](https://code.google.com/p/chromium/codesearch#chromium/src/net/base/net_error_list.h).
|
||||||
|
|
||||||
### `app.commandLine.appendSwitch(switch[, value])`
|
### `app.commandLine.appendSwitch(switch[, value])`
|
||||||
|
|
||||||
Append a switch (with optional `value`) to Chromium's command line.
|
Append a switch (with optional `value`) to Chromium's command line.
|
||||||
|
|
|
@ -89,7 +89,7 @@ describe('app module', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('app.importClientCertificate', function () {
|
describe('app.importCertificate', function () {
|
||||||
if (process.platform !== 'linux')
|
if (process.platform !== 'linux')
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ describe('app module', function () {
|
||||||
|
|
||||||
it('can import certificate into platform cert store', function (done) {
|
it('can import certificate into platform cert store', function (done) {
|
||||||
let options = {
|
let options = {
|
||||||
clientCertificate: path.join(certPath, 'client.p12'),
|
certificate: path.join(certPath, 'client.p12'),
|
||||||
password: 'electron'
|
password: 'electron'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,7 +143,7 @@ describe('app module', function () {
|
||||||
callback(list[0])
|
callback(list[0])
|
||||||
})
|
})
|
||||||
|
|
||||||
app.importClientCertificate(options, function (result) {
|
app.importCertificate(options, function (result) {
|
||||||
assert(!result)
|
assert(!result)
|
||||||
server.listen(0, '127.0.0.1', function () {
|
server.listen(0, '127.0.0.1', function () {
|
||||||
var port = server.address().port
|
var port = server.address().port
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue