Files
android/libwvdrmengine/cdm/core/include/certificate_provisioning.h
Rahul Frias 4e047b8b0c Make CdmProvisioningResponse const and DeviceFiles level support
* Make CdmProvisioningResponse const.

  [ Merge of http://go/wvgerrit/14618 ]

  The lack of const on this reference seems to be a mistake, since the
  responses is never modified.  This also allows the new CE CDM to pass
  responses directly through from the caller.

* Let Properties determine DeviceFiles level support

  [ Merge of http://go/wvgerrit/14620 ]

  Non-Android platforms do not have multiple security levels, and so do
  not use the security level to construct a base path.

  Instead of requiring a known "security level" to construct a file,
  accept anything that platform Properties will accept as a base path.

* Drop Properties::GetSecurityLevel().

  [ Merge of http://go/wvgerrit/14617 ]

  This seems to be dead code.

Change-Id: I94a970279213100730d6e6c763558dbe386f936a
2015-09-25 19:05:02 -07:00

48 lines
1.6 KiB
C++

// Copyright 2013 Google Inc. All Rights Reserved.
#ifndef WVCDM_CORE_CERTIFICATE_PROVISIONING_H_
#define WVCDM_CORE_CERTIFICATE_PROVISIONING_H_
#include <string>
#include "crypto_session.h"
#include "oemcrypto_adapter.h"
#include "wv_cdm_types.h"
namespace wvcdm {
class CdmSession;
class CertificateProvisioning {
public:
CertificateProvisioning() : cert_type_(kCertificateWidevine) {};
~CertificateProvisioning() {};
// Provisioning related methods
CdmResponseType GetProvisioningRequest(SecurityLevel requested_security_level,
CdmCertificateType cert_type,
const std::string& cert_authority,
const std::string& origin,
CdmProvisioningRequest* request,
std::string* default_url);
CdmResponseType HandleProvisioningResponse(
const std::string& origin,
const CdmProvisioningResponse& response,
std::string* cert,
std::string* wrapped_key);
private:
void ComposeJsonRequestAsQueryString(const std::string& message,
CdmProvisioningRequest* request);
bool ParseJsonResponse(const CdmProvisioningResponse& json_str,
const std::string& start_substr,
const std::string& end_substr, std::string* result);
CryptoSession crypto_session_;
CdmCertificateType cert_type_;
CORE_DISALLOW_COPY_AND_ASSIGN(CertificateProvisioning);
};
} // namespace wvcdm
#endif // WVCDM_CORE_CERTIFICATE_PROVISIONING_H_