58 lines
2.4 KiB
C++
58 lines
2.4 KiB
C++
////////////////////////////////////////////////////////////////////////////////
|
|
// Copyright 2020 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.
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
#ifndef COMMON_DUAL_CERTIFICATE_CLIENT_CERT_H_
|
|
#define COMMON_DUAL_CERTIFICATE_CLIENT_CERT_H_
|
|
|
|
#include "common/certificate_client_cert.h"
|
|
|
|
namespace widevine {
|
|
|
|
class DualCertificateClientCert : public ClientCert {
|
|
public:
|
|
DualCertificateClientCert() = default;
|
|
~DualCertificateClientCert() override = default;
|
|
DualCertificateClientCert(const DualCertificateClientCert&) = delete;
|
|
DualCertificateClientCert& operator=(const DualCertificateClientCert&) =
|
|
delete;
|
|
|
|
Status Initialize(const DrmRootCertificate* root_certificate,
|
|
const std::string& serialized_signing_certificate,
|
|
const std::string& serialized_encryption_certificate);
|
|
Status VerifySignature(const std::string& message,
|
|
HashAlgorithm hash_algorithm,
|
|
const std::string& signature,
|
|
ProtocolVersion protocol_version) const override;
|
|
void GenerateSigningKey(const std::string& message,
|
|
ProtocolVersion protocol_version) override;
|
|
|
|
const std::string& encrypted_key() const override;
|
|
const std::string& key() const override;
|
|
SignedMessage::SessionKeyType key_type() const override;
|
|
bool using_dual_certificate() const override { return true; }
|
|
const std::string& serial_number() const override;
|
|
const std::string& service_id() const override;
|
|
const std::string& signing_key() const override;
|
|
const std::string& signer_serial_number() const override;
|
|
uint32_t signer_creation_time_seconds() const override;
|
|
bool signed_by_provisioner() const override;
|
|
uint32_t system_id() const override;
|
|
widevine::ClientIdentification::TokenType type() const override {
|
|
return ClientIdentification::DRM_DEVICE_CERTIFICATE;
|
|
}
|
|
const std::string& encrypted_unique_id() const override;
|
|
const std::string& unique_id_hash() const override;
|
|
|
|
private:
|
|
CertificateClientCert signing_certificate_;
|
|
CertificateClientCert encryption_certificate_;
|
|
};
|
|
|
|
} // namespace widevine
|
|
#endif // COMMON_DUAL_CERTIFICATE_CLIENT_CERT_H_
|