Files
whitebox/whitebox/api/license_whitebox_benchmark.h
Aaron Vaage f936dd2983 Add "License Key Mode" To API
In order to support both single-key and dual-key RSA implementations
where single-key will use key 0 for both sign and encryption and where
dual-key will use key 0 for sign and key 1 for encryption.

Additional changes in this code drop:

 - Added VMP / RA override enabled tests
 - Added VMP / RA override disabled tests

This brings the partner repo in sync with the internal repo at
commit 71760b6da1ec546c65b56e2f86b39b73b53f6734.
2021-04-05 12:05:15 -07:00

47 lines
1.1 KiB
C++

// Copyright 2020 Google LLC. All Rights Reserved.
#ifndef WHITEBOX_API_LICENSE_WHITEBOX_BENCHMARK_H_
#define WHITEBOX_API_LICENSE_WHITEBOX_BENCHMARK_H_
#include <stdint.h>
#include <memory>
#include <vector>
#include "api/license_whitebox.h"
#include "api/test_key_types.h"
#include "api/test_license_builder.h"
#include "benchmarking/data_source.h"
#include "crypto_utils/rsa_key.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace widevine {
class LicenseWhiteboxBenchmark : public ::testing::Test {
protected:
virtual void SetUp() override;
License CreateLicense() const;
std::vector<uint8_t> SignAsServer(const std::vector<uint8_t>& message) const;
DataSource& Data() { return data_source_; }
const KeyId& ContentKeyId() const { return key_id_; }
const AesKey& ContentKey() const { return key_; }
const AesIv& ContentIV() const { return iv_; }
private:
DataSource data_source_;
std::unique_ptr<RsaPublicKey> encryption_public_key_;
KeyId key_id_;
AesKey key_;
AesIv iv_;
};
} // namespace widevine
#endif // WHITEBOX_API_LICENSE_WHITEBOX_BENCHMARK_H_