PlayReadyContentHeader 构造函数

定义

重载

PlayReadyContentHeader(Byte[])

初始化 PlayReadyContentHeader 类的新实例。

PlayReadyContentHeader(Byte[], Uri, Uri, String, Guid)

初始化 PlayReadyContentHeader 类的新实例。

PlayReadyContentHeader(Guid, String, PlayReadyEncryptionAlgorithm, Uri, Uri, String, Guid)

初始化 PlayReadyContentHeader 类的新实例。

PlayReadyContentHeader(UInt32, Guid[], String[], PlayReadyEncryptionAlgorithm, Uri, Uri, String, Guid)

初始化 PlayReadyContentHeader 类的新实例。

PlayReadyContentHeader(Byte[])

初始化 PlayReadyContentHeader 类的新实例。

public:
 PlayReadyContentHeader(Platform::Array <byte> ^ headerBytes);
 PlayReadyContentHeader(winrt::array_view <byte> const& headerBytes);
public PlayReadyContentHeader(byte[] headerBytes);
function PlayReadyContentHeader(headerBytes)
Public Sub New (headerBytes As Byte())

参数

headerBytes

Byte[]

byte[]

表示 PlayReady 内容标头的原始数据字节。

适用于

PlayReadyContentHeader(Byte[], Uri, Uri, String, Guid)

初始化 PlayReadyContentHeader 类的新实例。

public:
 PlayReadyContentHeader(Platform::Array <byte> ^ headerBytes, Uri ^ licenseAcquisitionUrl, Uri ^ licenseAcquisitionUserInterfaceUrl, Platform::String ^ customAttributes, Platform::Guid domainServiceId);
 PlayReadyContentHeader(winrt::array_view <byte> const& headerBytes, Uri const& licenseAcquisitionUrl, Uri const& licenseAcquisitionUserInterfaceUrl, winrt::hstring const& customAttributes, winrt::guid const& domainServiceId);
public PlayReadyContentHeader(byte[] headerBytes, System.Uri licenseAcquisitionUrl, System.Uri licenseAcquisitionUserInterfaceUrl, string customAttributes, Guid domainServiceId);
function PlayReadyContentHeader(headerBytes, licenseAcquisitionUrl, licenseAcquisitionUserInterfaceUrl, customAttributes, domainServiceId)
Public Sub New (headerBytes As Byte(), licenseAcquisitionUrl As Uri, licenseAcquisitionUserInterfaceUrl As Uri, customAttributes As String, domainServiceId As Guid)

参数

headerBytes

Byte[]

byte[]

表示旧版 WMDRM 标头的原始数据字节。

licenseAcquisitionUrl
Uri Uri

无提示 (无用户交互) 许可证获取 Web 服务。

licenseAcquisitionUserInterfaceUrl
Uri Uri

非无提示许可证获取网页的 URL。

customAttributes
String

Platform::String

winrt::hstring

包含内容提供程序使用的自定义数据。 内容作者可以在此元素中添加任意 XML。 Microsoft 代码不处理此元素中包含的任何数据。

domainServiceId
Guid

Platform::Guid

winrt::guid

域服务的服务标识符。

注解

应使用此构造函数将旧版 WMDRM 标头转换为 PlayReady 标头。

domainServiceId 参数对基础平台的终止性很敏感。 在打算支持的所有平台上仔细测试应用,以确保在每个平台上使用正确的结束度。

适用于

PlayReadyContentHeader(Guid, String, PlayReadyEncryptionAlgorithm, Uri, Uri, String, Guid)

初始化 PlayReadyContentHeader 类的新实例。

public:
 PlayReadyContentHeader(Platform::Guid contentKeyId, Platform::String ^ contentKeyIdString, PlayReadyEncryptionAlgorithm contentEncryptionAlgorithm, Uri ^ licenseAcquisitionUrl, Uri ^ licenseAcquisitionUserInterfaceUrl, Platform::String ^ customAttributes, Platform::Guid domainServiceId);
 PlayReadyContentHeader(winrt::guid const& contentKeyId, winrt::hstring const& contentKeyIdString, PlayReadyEncryptionAlgorithm const& contentEncryptionAlgorithm, Uri const& licenseAcquisitionUrl, Uri const& licenseAcquisitionUserInterfaceUrl, winrt::hstring const& customAttributes, winrt::guid const& domainServiceId);
public PlayReadyContentHeader(Guid contentKeyId, string contentKeyIdString, PlayReadyEncryptionAlgorithm contentEncryptionAlgorithm, System.Uri licenseAcquisitionUrl, System.Uri licenseAcquisitionUserInterfaceUrl, string customAttributes, Guid domainServiceId);
function PlayReadyContentHeader(contentKeyId, contentKeyIdString, contentEncryptionAlgorithm, licenseAcquisitionUrl, licenseAcquisitionUserInterfaceUrl, customAttributes, domainServiceId)
Public Sub New (contentKeyId As Guid, contentKeyIdString As String, contentEncryptionAlgorithm As PlayReadyEncryptionAlgorithm, licenseAcquisitionUrl As Uri, licenseAcquisitionUserInterfaceUrl As Uri, customAttributes As String, domainServiceId As Guid)

参数

contentKeyId
Guid

Platform::Guid

winrt::guid

内容加密密钥的标识符。

contentKeyIdString
String

Platform::String

winrt::hstring

内容密钥的字符串表示形式。 如果指定 了 contentKeyId 参数,则忽略此参数。

contentEncryptionAlgorithm
PlayReadyEncryptionAlgorithm

用于加密内容的加密算法类型。

licenseAcquisitionUrl
Uri Uri

无提示 (无用户交互) 许可证获取 Web 服务。

licenseAcquisitionUserInterfaceUrl
Uri Uri

非无提示许可证获取网页的 URL。

customAttributes
String

Platform::String

winrt::hstring

包含内容提供程序使用的自定义数据。 内容作者可以在此元素中添加任意 XML。 Microsoft 代码不处理此元素中包含的任何数据。

domainServiceId
Guid

Platform::Guid

winrt::guid

域服务的服务标识符。

注解

contentKeyIddomainServiceId 参数对基础平台的 endianness 敏感。 在打算支持的所有平台上仔细测试应用,以确保在每个平台上使用正确的结束度。

从 Windows 10版本 1709 开始,可以指定 PlayReadyEncryptionAlgorithm.Aes128Cbc、AES128CBC 加密或 PlayReadyEncryptionAlgorithm.Unspecified,以允许服务器后端确定加密类型,作为 contentEncryptionAlgorithm 参数的值。 在以前版本的Windows 10中,指定其中任一值都会导致引发异常。 因此,在构造函数调用中使用新的枚举值之前,应通过调用 ApiInformationIsApiContractPresent 并指定主协定版本 5 来检查枚举值是否存在。

bool supportsAes128CbcAndUnspecified = ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 5);

if (supportsAes128CbcAndUnspecified)
{
    // Guid and URL below are known by app, obtaining them is out of scope
    PlayReadyContentHeader header = new PlayReadyContentHeader(
        new Guid("{6591a70e-06fc-4d1f-862a-80bb569f07da}"),
        null,
        PlayReadyEncryptionAlgorithm.Unspecified,
        new Uri("http://www.contoso.com/rightsmanager.aspx"),
        null,
        null,
        new Guid("{215304E7-9263-446A-B150-0754D5E18973}"));

    var request = PlayReadyContentResolver.ServiceRequest(header);
    await request.BeginServiceRequest();
}
else
{
    // Application chooses behavior, for example, picks different content
    // or tells user that their system doesn’t support the selected content
}

适用于

PlayReadyContentHeader(UInt32, Guid[], String[], PlayReadyEncryptionAlgorithm, Uri, Uri, String, Guid)

初始化 PlayReadyContentHeader 类的新实例。

public:
 PlayReadyContentHeader(unsigned int dwFlags, Platform::Array <Platform::Guid> ^ contentKeyIds, Platform::Array <Platform::String ^> ^ contentKeyIdStrings, PlayReadyEncryptionAlgorithm contentEncryptionAlgorithm, Uri ^ licenseAcquisitionUrl, Uri ^ licenseAcquisitionUserInterfaceUrl, Platform::String ^ customAttributes, Platform::Guid domainServiceId);
 PlayReadyContentHeader(uint32_t const& dwFlags, winrt::array_view <winrt::guid> const& contentKeyIds, winrt::array_view <winrt::hstring const&> const& contentKeyIdStrings, PlayReadyEncryptionAlgorithm const& contentEncryptionAlgorithm, Uri const& licenseAcquisitionUrl, Uri const& licenseAcquisitionUserInterfaceUrl, winrt::hstring const& customAttributes, winrt::guid const& domainServiceId);
public PlayReadyContentHeader(uint dwFlags, Guid[] contentKeyIds, string[] contentKeyIdStrings, PlayReadyEncryptionAlgorithm contentEncryptionAlgorithm, System.Uri licenseAcquisitionUrl, System.Uri licenseAcquisitionUserInterfaceUrl, string customAttributes, Guid domainServiceId);
function PlayReadyContentHeader(dwFlags, contentKeyIds, contentKeyIdStrings, contentEncryptionAlgorithm, licenseAcquisitionUrl, licenseAcquisitionUserInterfaceUrl, customAttributes, domainServiceId)
Public Sub New (dwFlags As UInteger, contentKeyIds As Guid(), contentKeyIdStrings As String(), contentEncryptionAlgorithm As PlayReadyEncryptionAlgorithm, licenseAcquisitionUrl As Uri, licenseAcquisitionUserInterfaceUrl As Uri, customAttributes As String, domainServiceId As Guid)

参数

dwFlags
UInt32

unsigned int

uint32_t

保留。 设置为 0。

contentKeyIds

Guid[]

Platform::Guid[]

winrt::guid[]

内容加密密钥的标识符。

contentKeyIdStrings

String[]

Platform::String[]

winrt::hstring[]

内容键的字符串表示形式。 每个字符串必须是 Base-64 编码的 16 字节值。

contentEncryptionAlgorithm
PlayReadyEncryptionAlgorithm

用于加密内容的加密算法类型。

licenseAcquisitionUrl
Uri Uri

无提示 (无用户交互) 许可证获取 Web 服务。

licenseAcquisitionUserInterfaceUrl
Uri Uri

非无提示许可证获取网页的 URL。

customAttributes
String

Platform::String

winrt::hstring

包含内容提供程序使用的自定义数据。 内容作者可以在此元素中添加任意 XML。 Microsoft 代码不处理此元素中包含的任何数据。

domainServiceId
Guid

Platform::Guid

winrt::guid

域服务的服务标识符。

注解

contentKeyIdsdomainServiceId 参数对基础平台的 endianness 很敏感。 在打算支持的所有平台上仔细测试应用,以确保在每个平台上使用正确的结束度。

从 Windows 10版本 1709 开始,可以指定 PlayReadyEncryptionAlgorithm.Aes128Cbc、AES128CBC 加密或 PlayReadyEncryptionAlgorithm.Unspecified,以允许服务器后端确定加密类型,作为 contentEncryptionAlgorithm 参数的值。 在以前版本的Windows 10中,指定其中任一值都会导致引发异常。 因此,在构造函数调用中使用新的枚举值之前,应通过调用 ApiInformationIsApiContractPresent 并指定主协定版本 5 来检查枚举值是否存在。

bool supportsAes128CbcAndUnspecified = ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 5);

if (supportsAes128CbcAndUnspecified)
{
    // Guid and URL below are known by app, obtaining them is out of scope
    PlayReadyContentHeader header = new PlayReadyContentHeader(
        new Guid("{6591a70e-06fc-4d1f-862a-80bb569f07da}"),
        null,
        PlayReadyEncryptionAlgorithm.Unspecified,
        new Uri("http://www.contoso.com/rightsmanager.aspx"),
        null,
        null,
        new Guid("{215304E7-9263-446A-B150-0754D5E18973}"));

    var request = PlayReadyContentResolver.ServiceRequest(header);
    await request.BeginServiceRequest();
}
else
{
    // Application chooses behavior, for example, picks different content
    // or tells user that their system doesn’t support the selected content
}

适用于