Export media_cas_proxy_sdk
This commit is contained in:
86
common/wvm_test_keys.cc
Normal file
86
common/wvm_test_keys.cc
Normal file
@@ -0,0 +1,86 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright 2016 Google LLC.
|
||||
//
|
||||
// This software is licensed under the terms defined in the Widevine Master
|
||||
// License Agreement. For a copy of this agreement, please contact
|
||||
// widevine-licensing@google.com.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "absl/strings/escaping.h"
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "common/wvm_test_keys.h"
|
||||
#include "common/wvm_token_handler.h"
|
||||
|
||||
namespace widevine {
|
||||
namespace wvm_test_keys {
|
||||
|
||||
// Preprov key and keyboxes in this header use system ID 0x112.
|
||||
const char kTestPreprovKeyHex[] = "f7538b38acc78ec68c732ac665c55c65";
|
||||
const char kBadPreprovKey1Hex[] = "1badbadbadbadbadbadbadbadbadbad1";
|
||||
const char kBadPreprovKey2Hex[] = "2badbadbadbadbadbadbadbadbadbad2";
|
||||
|
||||
const char kTestToken1Hex[] =
|
||||
"00000002000001128e1ebfe037828096ca6538b4f6f4bcb51c2b7191cf037e98"
|
||||
"beaa24924907e128f9ff49b54a165cd9c33e6547537eb4d29fb7e8df3c2c1cd9"
|
||||
"2517a12f4922953e";
|
||||
|
||||
// The device key corresponding to kTestToken1.
|
||||
const char kTestDeviceKey1Hex[] = "4071197f1f8910d9bf10c6bc4c987638";
|
||||
|
||||
// Base64Encode(kTestToken1)
|
||||
const char kTestToken1Base64[] =
|
||||
"AAAAAgAAARKOHr/gN4KAlsplOLT29Ly1HCtxkc8Dfpi+qiSSSQfhKPn/SbVKFlzZ"
|
||||
"wz5lR1N+tNKft+jfPCwc2SUXoS9JIpU+";
|
||||
|
||||
const char kTestToken2Hex[] =
|
||||
"0000000200000112d906feebe1750c5886ff77c2dfa31bb40e002f3adbc0fa5b"
|
||||
"eb2486cf5f419549cdaa23230e5165ac2ffab56d53b692b7ba0c1857400c6add"
|
||||
"3af3ff3d5cb24985";
|
||||
|
||||
// The device key corresponding to kTestToken2.
|
||||
const char kTestDeviceKey2Hex[] = "42cfb1765201042302a404d1e0fac8ed";
|
||||
|
||||
// Base64Encode(kTestToken2)
|
||||
const char kTestToken2Base64[] =
|
||||
"AAAAAgAAARLZBv7r4XUMWIb/d8Lfoxu0DgAvOtvA+lvrJIbPX0GVSc2qIyMOUWWs"
|
||||
"L/q1bVO2kre6DBhXQAxq3Trz/z1cskmF";
|
||||
|
||||
const char kTestToken3DesHex[] =
|
||||
"00000002100000138e1ebfe037828096ca6538b4f6f4bcb51c2b7191cf037e98"
|
||||
"beaa24924907e128f9ff49b54a165cd9c33e6547537eb4d29fb7e8df3c2c1cd9"
|
||||
"2517a12f4922953e";
|
||||
|
||||
const char kTestDeviceKey3DesHex[] = "4071197f1f8910d9bf10c6bc4c987638";
|
||||
|
||||
std::vector<WvmTokenHandler::PreprovKey> GetPreprovKeyVector() {
|
||||
return {
|
||||
// Return multiple preprov keys for the same device.
|
||||
WvmTokenHandler::PreprovKey(kTestSystemId,
|
||||
absl::HexStringToBytes(kBadPreprovKey1Hex)),
|
||||
WvmTokenHandler::PreprovKey(kTestSystemId,
|
||||
absl::HexStringToBytes(kTestPreprovKeyHex)),
|
||||
WvmTokenHandler::PreprovKey(kTestSystemId,
|
||||
absl::HexStringToBytes(kBadPreprovKey2Hex)),
|
||||
|
||||
// Add another device that uses 3DES encryption for asset keys. Tokens
|
||||
// the same except for the system ID portion.
|
||||
WvmTokenHandler::PreprovKey(kTestSystemId3Des,
|
||||
absl::HexStringToBytes(kTestPreprovKeyHex),
|
||||
WvmTokenHandler::DES3),
|
||||
};
|
||||
}
|
||||
|
||||
std::map<uint32_t, std::string> GetPreprovKeyTable() {
|
||||
return {{kTestSystemId, std::string(kTestPreprovKeyHex)}};
|
||||
}
|
||||
|
||||
std::multimap<uint32_t, std::string> GetPreprovKeyMultimap() {
|
||||
return {{kTestSystemId, kBadPreprovKey1Hex},
|
||||
{kTestSystemId, kTestPreprovKeyHex},
|
||||
{kTestSystemId, kBadPreprovKey2Hex}};
|
||||
}
|
||||
|
||||
} // namespace wvm_test_keys
|
||||
} // namespace widevine
|
||||
Reference in New Issue
Block a user