// Copyright 2012 Google Inc. All Rights Reserved. #ifndef CDM_BASE_LICENSE_H_ #define CDM_BASE_LICENSE_H_ #include "license_protocol.pb.h" #include "wv_cdm_types.h" namespace wvcdm { using video_widevine_server::sdk::LicenseIdentification; using video_widevine_server::sdk::SignedMessage; class CryptoSession; class PolicyEngine; class CdmLicense { public: CdmLicense(); ~CdmLicense(); bool Init(const std::string& token, CryptoSession* session, PolicyEngine* policy_engine); bool PrepareKeyRequest(const CdmInitData& pssh_data, const CdmLicenseType license_type, CdmAppParameterMap& app_parameters, CdmKeyMessage* signed_request); bool PrepareKeyRenewalRequest(CdmKeyMessage* signed_request); CdmResponseType HandleKeyResponse(const CdmKeyResponse& license_response); CdmResponseType HandleKeyRenewalResponse( const CdmKeyResponse& license_response); private: CdmResponseType HandleKeyErrorResponse(const SignedMessage& signed_message); LicenseIdentification license_id_; CryptoSession* session_; PolicyEngine* policy_engine_; std::string token_; // Used for certificate based licensing CdmKeyMessage key_request_; CORE_DISALLOW_COPY_AND_ASSIGN(CdmLicense); }; } // namespace wvcdm #endif // CDM_BASE_LICENSE_H_