1a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)// Copyright 2013 The Chromium Authors. All rights reserved.
2a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
3a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)// found in the LICENSE file.
4a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)
5a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)#include "net/cert/ct_known_logs.h"
6a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)
7116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch#include <string>
8116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch
9116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch#include "base/macros.h"
10a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)#include "base/strings/string_piece.h"
11116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch#include "net/cert/ct_known_logs_static.h"
12a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)#include "net/cert/ct_log_verifier.h"
13a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)
14a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)namespace net {
15a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)
16a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)namespace ct {
17a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)
18116680a4aac90f2aa7413d9095a592090648e557Ben MurdochScopedVector<CTLogVerifier> CreateLogVerifiersForKnownLogs() {
19116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch  ScopedVector<CTLogVerifier> verifiers;
20116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch  for (size_t i = 0; i < arraysize(kCTLogList); ++i) {
21116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch    const CTLogInfo& log(kCTLogList[i]);
22116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch    base::StringPiece key(log.log_key, arraysize(log.log_key) - 1);
23a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)
24116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch    verifiers.push_back(CTLogVerifier::Create(key, log.log_name).release());
25116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch  }
26a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)
27116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch  return verifiers.Pass();
28a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)}
29a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)
30a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)}  // namespace ct
31a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)
32a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)}  // namespace net
33a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)
34