Files
media_cas_packager_sdk_source/common/test_drm_certificates.h
2020-01-27 16:05:15 -08:00

92 lines
3.1 KiB
C++

////////////////////////////////////////////////////////////////////////////////
// Copyright 2016 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.
////////////////////////////////////////////////////////////////////////////////
//
// Class contains certificates that can be used for testing. Provides methods
// to retrieve a test root certificate, a test intermediate certificate and a
// test user device certificate.
#ifndef COMMON_TEST_DRM_CERTIFICATES_H_
#define COMMON_TEST_DRM_CERTIFICATES_H_
#include <string>
namespace widevine {
class TestDrmCertificates {
public:
TestDrmCertificates();
TestDrmCertificates(const TestDrmCertificates&) = delete;
TestDrmCertificates& operator=(const TestDrmCertificates&) = delete;
virtual ~TestDrmCertificates() {}
// returns a test root certificate
const std::string& test_root_certificate() const {
return test_root_certificate_;
}
// returns a test intermediate certificate with an RSA key
const std::string& test_intermediate_certificate() const {
return test_intermediate_certificate_;
}
// returns a test intermediate certificate with an EC key
const std::string& test_intermediate_certificate_with_ec_key() const {
return test_intermediate_certificate_with_ec_key_;
}
// returns a user device certificate with an RSA key
const std::string& test_user_device_certificate() const {
return test_user_device_certificate_;
}
// returns a user device certificate with an EC key
const std::string& test_user_device_certificate_with_ec_key() const {
return test_user_device_certificate_with_ec_key_;
}
// returns a user device certificate with a Root of Trust Id.
const std::string& test_user_device_certificate_with_rot_id() const {
return test_user_device_certificate_with_rot_id_;
}
// returns a service certificate with license sdk service type
const std::string& test_service_certificate_license_sdk() const {
return test_service_certificate_license_sdk_;
}
// returns a service certificate with all service types
const std::string& test_service_certificate_all_types() const {
return test_service_certificate_all_types_;
}
// returns a service certificate prior to a change requiring the service
// type to be specified.
const std::string& test_service_certificate_no_type() const {
return test_service_certificate_no_type_;
}
private:
const std::string test_root_certificate_;
const std::string test_intermediate_certificate_;
const std::string test_intermediate_certificate_with_ec_key_;
const std::string test_user_device_certificate_;
const std::string test_user_device_certificate_with_ec_key_;
const std::string test_user_device_certificate_with_rot_id_;
const std::string test_service_certificate_license_sdk_;
const std::string test_service_certificate_all_types_;
const std::string test_service_certificate_no_type_;
};
} // namespace widevine
#endif // COMMON_TEST_DRM_CERTIFICATES_H_