Revert "Fix broken channel icon in chrome://help on CrOS" and try again
[chromium-blink-merge.git] / net / cert / x509_certificate_net_log_param.cc
blob72b1e919aa7c7ba0adafc4883909f8fa71011104
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "net/cert/x509_certificate_net_log_param.h"
7 #include <string>
8 #include <vector>
10 #include "base/values.h"
11 #include "net/cert/x509_certificate.h"
13 namespace net {
15 scoped_ptr<base::Value> NetLogX509CertificateCallback(
16 const X509Certificate* certificate,
17 NetLogCaptureMode capture_mode) {
18 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
19 scoped_ptr<base::ListValue> certs(new base::ListValue());
20 std::vector<std::string> encoded_chain;
21 certificate->GetPEMEncodedChain(&encoded_chain);
22 for (size_t i = 0; i < encoded_chain.size(); ++i)
23 certs->Append(new base::StringValue(encoded_chain[i]));
24 dict->Set("certificates", certs.Pass());
25 return dict.Pass();
28 } // namespace net