blob: 4b0b1d6d961ef261c5511e8d38180d5ebc86ca29 [file] [log] [blame]
// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SHILL_NSS_
#define SHILL_NSS_
#include <string>
#include <vector>
#include <base/files/file_path.h>
#include <base/lazy_instance.h>
#include <gtest/gtest_prod.h> // for FRIEND_TEST
namespace shill {
class Minijail;
class NSS {
public:
virtual ~NSS();
// This is a singleton -- use NSS::GetInstance()->Foo().
static NSS *GetInstance();
// Returns an empty path on failure.
virtual base::FilePath GetPEMCertfile(const std::string &nickname,
const std::vector<char> &id);
// Returns an empty path on failure.
virtual base::FilePath GetDERCertfile(const std::string &nickname,
const std::vector<char> &id);
protected:
NSS();
private:
friend struct base::DefaultLazyInstanceTraits<NSS>;
friend class NSSTest;
FRIEND_TEST(NSSTest, GetCertfile);
base::FilePath GetCertfile(const std::string &nickname,
const std::vector<char> &id,
const std::string &type);
Minijail *minijail_;
DISALLOW_COPY_AND_ASSIGN(NSS);
};
} // namespace shill
#endif // SHILL_NSS_