Files
android/libwvdrmengine/cdm/core/include/client_identification.h
Daniel Chapin d69b488be1 Revert "Merge latest oemcrypto-v17 change"
This reverts commit 642965c678.

Reason for revert: Droidfood Blocking Bug: 217145027

Change-Id: I669b72fcd91c62e28883b5f55eb36af274d85806
(cherry picked from commit 8dbea15e5da05b371572297041454569dc166c90)
Merged-In:I669b72fcd91c62e28883b5f55eb36af274d85806
2022-01-31 23:10:49 +00:00

64 lines
2.3 KiB
C++

// Copyright 2018 Google LLC. All Rights Reserved. This file and proprietary
// source code may only be used and distributed under the Widevine License
// Agreement.
#ifndef WVCDM_CORE_CLIENT_IDENTIFICATION_H_
#define WVCDM_CORE_CLIENT_IDENTIFICATION_H_
#include <string>
// ClientIdentification fills in the ClientIdentification portion
// of the License or Provisioning request messages.
#include "disallow_copy_and_assign.h"
#include "license_protocol.pb.h"
#include "wv_cdm_types.h"
namespace wvcdm {
class CryptoSession;
class ClientIdentification {
public:
ClientIdentification() {}
virtual ~ClientIdentification() {}
// Call this method when used with provisioning requests
CdmResponseType InitForProvisioning(CryptoSession* crypto_session);
// Use in conjunction with license requests
// |client_token| must be provided
// |crypto_session| input parameter, mandatory
CdmResponseType InitForLicenseRequest(const std::string& client_token,
CryptoSession* crypto_session);
CdmResponseType InitForOtaKeyboxProvisioning(CryptoSession* crypto_session);
// Fill the ClientIdentification portion of the license, DRM cert
// provisioning or OTA keybox provisioning request.
// |app_parameters| parameters provided by client/app to be included in
// provisioning/license request. optional, only used
// if |is_license_request| is true
// |provider_client_token| optional parameter specified by the content
// and included in the license. Only used if
// specified and if |is_license_request| is true
// |client_id| Portion of license/provisioning request that needs to be
// populated.
virtual CdmResponseType Prepare(
const CdmAppParameterMap& app_parameters,
const std::string& provider_client_token,
video_widevine::ClientIdentification* client_id);
private:
bool GetProvisioningTokenType(
video_widevine::ClientIdentification::TokenType* token_type);
bool is_license_request_ = false;
bool is_okp_request_ = false;
std::string client_token_;
std::string device_id_;
CryptoSession* crypto_session_ = nullptr;
CORE_DISALLOW_COPY_AND_ASSIGN(ClientIdentification);
};
} // namespace wvcdm
#endif // WVCDM_CORE_CLIENT_IDENTIFICATION_H_