OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/extensions/api/platform_keys/platform_keys_api.h" | 5 #include "chrome/browser/extensions/api/platform_keys/platform_keys_api.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 base::DictionaryValue* algorithm) { | 58 base::DictionaryValue* algorithm) { |
59 CHECK_EQ(net::X509Certificate::kPublicKeyTypeRSA, key_info.key_type); | 59 CHECK_EQ(net::X509Certificate::kPublicKeyTypeRSA, key_info.key_type); |
60 algorithm->SetStringWithoutPathExpansion("name", kWebCryptoRSASSA_PKCS1_v1_5); | 60 algorithm->SetStringWithoutPathExpansion("name", kWebCryptoRSASSA_PKCS1_v1_5); |
61 algorithm->SetIntegerWithoutPathExpansion("modulusLength", | 61 algorithm->SetIntegerWithoutPathExpansion("modulusLength", |
62 key_info.key_size_bits); | 62 key_info.key_size_bits); |
63 | 63 |
64 // Equals 65537. | 64 // Equals 65537. |
65 const unsigned char defaultPublicExponent[] = {0x01, 0x00, 0x01}; | 65 const unsigned char defaultPublicExponent[] = {0x01, 0x00, 0x01}; |
66 algorithm->SetWithoutPathExpansion( | 66 algorithm->SetWithoutPathExpansion( |
67 "publicExponent", | 67 "publicExponent", |
68 base::BinaryValue::CreateWithCopiedBuffer( | 68 base::Value::CreateWithCopiedBuffer( |
69 reinterpret_cast<const char*>(defaultPublicExponent), | 69 reinterpret_cast<const char*>(defaultPublicExponent), |
70 arraysize(defaultPublicExponent))); | 70 arraysize(defaultPublicExponent))); |
71 } | 71 } |
72 | 72 |
73 const struct NameValuePair { | 73 const struct NameValuePair { |
74 const char* const name; | 74 const char* const name; |
75 const int value; | 75 const int value; |
76 } kCertStatusErrors[] = { | 76 } kCertStatusErrors[] = { |
77 #define CERT_STATUS_FLAG(name, value) \ | 77 #define CERT_STATUS_FLAG(name, value) \ |
78 { #name, value } \ | 78 { #name, value } \ |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 result.debug_errors.push_back(kCertStatusErrors[i].name); | 384 result.debug_errors.push_back(kCertStatusErrors[i].name); |
385 } | 385 } |
386 } | 386 } |
387 } | 387 } |
388 | 388 |
389 Respond(ArgumentList( | 389 Respond(ArgumentList( |
390 api_pk::VerifyTLSServerCertificate::Results::Create(result))); | 390 api_pk::VerifyTLSServerCertificate::Results::Create(result))); |
391 } | 391 } |
392 | 392 |
393 } // namespace extensions | 393 } // namespace extensions |
OLD | NEW |