Files
android/libwvdrmengine/tools/factory_upload_tool/aosp/include/BccParser.h
conglin 7496c1c84c Move ASOP factory extraction tool to its own directory
Moved some source to common folder.
Added uploading script which is also shared by CE CDM partners.
Added README.

Test: m wv_factory_extraction_tool
Bug: 414642286
Change-Id: I565027b75528ab28f9f1eb8d9086c0213de992d0
2025-06-17 06:23:03 +00:00

49 lines
1.5 KiB
C++

// Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary
// source code may only be used and distributed under the Widevine License
// Agreement.
#ifndef BCC_PARSER_H_
#define BCC_PARSER_H_
#include <cppbor.h>
#include <stddef.h>
#include <stdint.h>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
namespace widevine {
// BccParser processes a Provisioning 4.0 device root of trust. It extracts
// relevant pieces of information and outputs to std::string.
// Relevant documents:
// Android definition: go/remote-provisioning-hal#bcc.
// Google Dice Profile: go/dice-profile
class BccParser {
public:
explicit BccParser() {}
virtual ~BccParser() = default;
BccParser(const BccParser&) = delete;
BccParser& operator=(const BccParser&) = delete;
// Parse and verify a client generated root of trust. This message is part of
// an attestation model conforming to the Google Open Dice Profile. This
// message is received from a client device to attest it is a valid Widevine
// device.
virtual std::string Parse(const std::vector<uint8_t>& bcc);
private:
// Process and print CoseKey PubKeyEd25519 / PubKeyECDSA256.
bool ProcessDevicePublicKeyInfo(std::stringstream& ss,
const cppbor::Map& public_key_info_map);
// Process and print the DiceChainEntryPayload, which contains subject public
// key.
bool ProcessDiceChainEntryPayload(std::stringstream& ss,
std::string& payload);
};
} // namespace widevine
#endif // BCC_PARSER_H_