blob: 4483ca80d054adc7efb3778ad72c6b911d17bb10 [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 CHAPS_TPM_UTILITY_MOCK_H
#define CHAPS_TPM_UTILITY_MOCK_H
#include "chaps/tpm_utility.h"
#include <base/basictypes.h>
#include <gmock/gmock.h>
namespace chaps {
class TPMUtilityMock : public TPMUtility {
public:
TPMUtilityMock();
virtual ~TPMUtilityMock();
MOCK_METHOD0(Init, bool());
MOCK_METHOD5(Authenticate, bool(int,
const chromeos::SecureBlob&,
const std::string&,
const std::string&,
chromeos::SecureBlob*));
MOCK_METHOD5(ChangeAuthData, bool(int,
const chromeos::SecureBlob&,
const chromeos::SecureBlob&,
const std::string&,
std::string*));
MOCK_METHOD2(GenerateRandom, bool(int, std::string*));
MOCK_METHOD1(StirRandom, bool(const std::string&));
MOCK_METHOD6(GenerateKey, bool(int,
int,
const std::string&,
const chromeos::SecureBlob&,
std::string*,
int*));
MOCK_METHOD3(GetPublicKey, bool(int, std::string*, std::string*));
MOCK_METHOD7(WrapKey, bool(int,
const std::string&,
const std::string&,
const std::string&,
const chromeos::SecureBlob&,
std::string*,
int*));
MOCK_METHOD4(LoadKey, bool(int,
const std::string&,
const chromeos::SecureBlob&,
int*));
MOCK_METHOD5(LoadKeyWithParent, bool(int,
const std::string&,
const chromeos::SecureBlob&,
int,
int*));
MOCK_METHOD1(UnloadKeysForSlot, void(int));
MOCK_METHOD3(Bind, bool(int, const std::string&, std::string*));
MOCK_METHOD3(Unbind, bool(int, const std::string&, std::string*));
MOCK_METHOD3(Sign, bool(int, const std::string&, std::string*));
MOCK_METHOD3(Verify, bool(int, const std::string&, const std::string&));
MOCK_METHOD0(IsSRKReady, bool());
private:
DISALLOW_COPY_AND_ASSIGN(TPMUtilityMock);
};
} // namespace chaps
#endif // CHAPS_TPM_UTILITY_MOCK_H