Delen via


PlayReadyContentHeader Constructors

Definition

Overloads

PlayReadyContentHeader(Byte[])

Initializes a new instance of the PlayReadyContentHeader class.

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

Initializes a new instance of the PlayReadyContentHeader class.

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

Initializes a new instance of the PlayReadyContentHeader class.

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

Initializes a new instance of the PlayReadyContentHeader class.

PlayReadyContentHeader(Byte[])

Initializes a new instance of the PlayReadyContentHeader class.

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())

Parameters

headerBytes

Byte[]

byte[]

Raw data bytes representing a PlayReady content header.

Applies to

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

Initializes a new instance of the PlayReadyContentHeader class.

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)

Parameters

headerBytes

Byte[]

byte[]

Raw data bytes representing a legacy WMDRM header.

licenseAcquisitionUrl
Uri Uri

The URL for the silent (no user interaction) license acquisition Web service.

licenseAcquisitionUserInterfaceUrl
Uri Uri

The URL for a non-silent license acquisition Web page.

customAttributes
String

Platform::String

winrt::hstring

Contains custom data used by the content provider. The content author can add arbitrary XML inside this element. Microsoft code does not act on any data contained inside this element.

domainServiceId
Guid

Platform::Guid

winrt::guid

Service identifier for the domain service.

Remarks

This constructor should be used to convert a legacy WMDRM header to a PlayReady header.

The domainServiceId parameter is sensitive to the underlying platform's endianness. Carefully test your app on all platforms you intend to support to ensure that correct endianness is used on each platform.

Applies to

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

Initializes a new instance of the PlayReadyContentHeader class.

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)

Parameters

contentKeyId
Guid

Platform::Guid

winrt::guid

Identifier of the content encryption key.

contentKeyIdString
String

Platform::String

winrt::hstring

String representation of the content key. If the contentKeyId parameter is specified, then this parameter is ignored.

contentEncryptionAlgorithm
PlayReadyEncryptionAlgorithm

Encryption algorithm type used to encrypt the content.

licenseAcquisitionUrl
Uri Uri

The URL for the silent (no user interaction) license acquisition Web service.

licenseAcquisitionUserInterfaceUrl
Uri Uri

The URL for a non-silent license acquisition Web page.

customAttributes
String

Platform::String

winrt::hstring

Contains custom data used by the content provider. The content author can add arbitrary XML inside this element. Microsoft code does not act on any data contained inside this element.

domainServiceId
Guid

Platform::Guid

winrt::guid

Service identifier for the domain service.

Remarks

The contentKeyId and domainServiceId parameters are sensitive to the underlying platform's endianness. Carefully test your app on all platforms you intend to support to ensure that correct endianness is used on each platform.

Starting with Windows 10, version 1709, you can specify PlayReadyEncryptionAlgorithm.Aes128Cbc, for AES128CBC encryption, or PlayReadyEncryptionAlgorithm.Unspecified, to allow the server backend to determine the encryption type, as the value for the contentEncryptionAlgorithm parameter. On previous versions of Windows 10, specifying either of these values will cause an exception to be thrown. For this reason, you should check for the presence of the enumeration value by calling ApiInformationIsApiContractPresent and specifying major contract version 5 before using the new enum values in the constructor call.

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
}

Applies to

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

Initializes a new instance of the PlayReadyContentHeader class.

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)

Parameters

dwFlags
UInt32

unsigned int

uint32_t

Reserved. Set to 0.

contentKeyIds

Guid[]

Platform::Guid[]

winrt::guid[]

Identifiers of the content encryption keys.

contentKeyIdStrings

String[]

Platform::String[]

winrt::hstring[]

String representations of the content keys. Each string must be a Base-64 encoded 16 byte value.

contentEncryptionAlgorithm
PlayReadyEncryptionAlgorithm

Encryption algorithm type used to encrypt the content.

licenseAcquisitionUrl
Uri Uri

The URL for the silent (no user interaction) license acquisition Web service.

licenseAcquisitionUserInterfaceUrl
Uri Uri

The URL for a non-silent license acquisition Web page.

customAttributes
String

Platform::String

winrt::hstring

Contains custom data used by the content provider. The content author can add arbitrary XML inside this element. Microsoft code does not act on any data contained inside this element.

domainServiceId
Guid

Platform::Guid

winrt::guid

Service identifier for the domain service.

Remarks

The contentKeyIds and domainServiceId parameters are sensitive to the underlying platform's endianness. Carefully test your app on all platforms you intend to support to ensure that correct endianness is used on each platform.

Starting with Windows 10, version 1709, you can specify PlayReadyEncryptionAlgorithm.Aes128Cbc, for AES128CBC encryption, or PlayReadyEncryptionAlgorithm.Unspecified, to allow the server backend to determine the encryption type, as the value for the contentEncryptionAlgorithm parameter. On previous versions of Windows 10, specifying either of these values will cause an exception to be thrown. For this reason, you should check for the presence of the enumeration value by calling ApiInformationIsApiContractPresent and specifying major contract version 5 before using the new enum values in the constructor call.

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
}

Applies to