• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2012 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "net/cert/x509_certificate_net_log_param.h"
6 
7 #include <memory>
8 #include <string>
9 #include <utility>
10 #include <vector>
11 
12 #include "base/values.h"
13 #include "net/cert/x509_certificate.h"
14 #include "net/log/net_log_capture_mode.h"
15 
16 namespace net {
17 
NetLogX509CertificateList(const X509Certificate * certificate)18 base::Value NetLogX509CertificateList(const X509Certificate* certificate) {
19   base::Value::List certs;
20   std::vector<std::string> encoded_chain;
21   certificate->GetPEMEncodedChain(&encoded_chain);
22   for (auto& pem : encoded_chain)
23     certs.Append(std::move(pem));
24   return base::Value(std::move(certs));
25 }
26 
27 }  // namespace net
28