PlayReadyContentHeader
PlayReadyContentHeader
PlayReadyContentHeader
PlayReadyContentHeader
Class
Definition
Represents the information in a PlayReady content header.
public : sealed class PlayReadyContentHeader : IPlayReadyContentHeader, IPlayReadyContentHeader2public sealed class PlayReadyContentHeader : IPlayReadyContentHeader, IPlayReadyContentHeader2Public NotInheritable Class PlayReadyContentHeader Implements IPlayReadyContentHeader, IPlayReadyContentHeader2// You can use this class in JavaScript.
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Constructors
PlayReadyContentHeader(Byte[]) PlayReadyContentHeader(Byte[]) PlayReadyContentHeader(Byte[]) PlayReadyContentHeader(Byte[])
Initializes a new instance of the PlayReadyContentHeader class.
public : PlayReadyContentHeader(Byte[] headerBytes)public PlayReadyContentHeader(Byte[] headerBytes)Public Sub New(headerBytes As Byte[])// You can use this method in JavaScript.
- headerBytes
- Byte[] Byte[] Byte[] Byte[]
Raw data bytes representing a PlayReady content header.
- See Also
-
PlayReadyContentHeader(Guid, String, PlayReadyEncryptionAlgorithm, Uri, Uri, String, Guid)PlayReadyContentHeader(Guid, String, PlayReadyEncryptionAlgorithm, Uri, Uri, String, Guid)PlayReadyContentHeader(Guid, String, PlayReadyEncryptionAlgorithm, Uri, Uri, String, Guid)PlayReadyContentHeader(Guid, String, PlayReadyEncryptionAlgorithm, Uri, Uri, String, Guid)
PlayReadyContentHeader(Byte[], Uri, Uri, String, Guid) PlayReadyContentHeader(Byte[], Uri, Uri, String, Guid) PlayReadyContentHeader(Byte[], Uri, Uri, String, Guid) PlayReadyContentHeader(Byte[], Uri, Uri, String, Guid)
Initializes a new instance of the PlayReadyContentHeader class.
public : PlayReadyContentHeader(Byte[] headerBytes, Uri licenseAcquisitionUrl, Uri licenseAcquisitionUserInterfaceUrl, PlatForm::String customAttributes, PlatForm::Guid domainServiceId)public PlayReadyContentHeader(Byte[] headerBytes, Uri licenseAcquisitionUrl, Uri licenseAcquisitionUserInterfaceUrl, String customAttributes, Guid domainServiceId)Public Sub New(headerBytes As Byte[], licenseAcquisitionUrl As Uri, licenseAcquisitionUserInterfaceUrl As Uri, customAttributes As String, domainServiceId As Guid)// You can use this method in JavaScript.
- headerBytes
- Byte[] Byte[] Byte[] Byte[]
Raw data bytes representing a legacy WMDRM header.
- licenseAcquisitionUrl
- Uri Uri Uri Uri
The URL for the silent (no user interaction) license acquisition Web service.
- licenseAcquisitionUserInterfaceUrl
- Uri Uri Uri Uri
The URL for a non-silent license acquisition Web page.
- customAttributes
- PlatForm::String String String String
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
- PlatForm::Guid Guid Guid 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.
- See Also
-
PlayReadyContentHeader(Guid, String, PlayReadyEncryptionAlgorithm, Uri, Uri, String, Guid)PlayReadyContentHeader(Guid, String, PlayReadyEncryptionAlgorithm, Uri, Uri, String, Guid)PlayReadyContentHeader(Guid, String, PlayReadyEncryptionAlgorithm, Uri, Uri, String, Guid)PlayReadyContentHeader(Guid, String, PlayReadyEncryptionAlgorithm, Uri, Uri, String, Guid)
PlayReadyContentHeader(Guid, String, PlayReadyEncryptionAlgorithm, Uri, Uri, String, Guid) PlayReadyContentHeader(Guid, String, PlayReadyEncryptionAlgorithm, Uri, Uri, String, Guid) PlayReadyContentHeader(Guid, String, PlayReadyEncryptionAlgorithm, Uri, Uri, String, Guid) 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)public PlayReadyContentHeader(Guid contentKeyId, String contentKeyIdString, PlayReadyEncryptionAlgorithm contentEncryptionAlgorithm, Uri licenseAcquisitionUrl, Uri licenseAcquisitionUserInterfaceUrl, String customAttributes, Guid 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)// You can use this method in JavaScript.
- contentKeyId
- PlatForm::Guid Guid Guid Guid
Identifier of the content encryption key.
- contentKeyIdString
- PlatForm::String String String String
String representation of the content key. If the contentKeyId parameter is specified, then this parameter is ignored.
- contentEncryptionAlgorithm
- PlayReadyEncryptionAlgorithm PlayReadyEncryptionAlgorithm PlayReadyEncryptionAlgorithm PlayReadyEncryptionAlgorithm
Encryption algorithm type used to encrypt the content.
- licenseAcquisitionUrl
- Uri Uri Uri Uri
The URL for the silent (no user interaction) license acquisition Web service.
- licenseAcquisitionUserInterfaceUrl
- Uri Uri Uri Uri
The URL for a non-silent license acquisition Web page.
- customAttributes
- PlatForm::String String String String
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
- PlatForm::Guid Guid Guid 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, e.g. picks different content
// or tells user that their system doesn’t support the selected content
}
- See Also
PlayReadyContentHeader(UInt32, Guid[], String[], PlayReadyEncryptionAlgorithm, Uri, Uri, String, Guid) PlayReadyContentHeader(UInt32, Guid[], String[], PlayReadyEncryptionAlgorithm, Uri, Uri, String, Guid) PlayReadyContentHeader(UInt32, Guid[], String[], PlayReadyEncryptionAlgorithm, Uri, Uri, String, Guid) PlayReadyContentHeader(UInt32, Guid[], String[], PlayReadyEncryptionAlgorithm, Uri, Uri, String, Guid)
Initializes a new instance of the PlayReadyContentHeader class.
public : PlayReadyContentHeader(unsigned int dwFlags, PlatForm::Guid[] contentKeyIds, PlatForm::String[] contentKeyIdStrings, PlayReadyEncryptionAlgorithm contentEncryptionAlgorithm, Uri licenseAcquisitionUrl, Uri licenseAcquisitionUserInterfaceUrl, PlatForm::String customAttributes, PlatForm::Guid domainServiceId)public PlayReadyContentHeader(UInt32 dwFlags, Guid[] contentKeyIds, String[] contentKeyIdStrings, PlayReadyEncryptionAlgorithm contentEncryptionAlgorithm, Uri licenseAcquisitionUrl, Uri licenseAcquisitionUserInterfaceUrl, String customAttributes, Guid domainServiceId)Public Sub New(dwFlags As UInt32, contentKeyIds As Guid[], contentKeyIdStrings As String[], contentEncryptionAlgorithm As PlayReadyEncryptionAlgorithm, licenseAcquisitionUrl As Uri, licenseAcquisitionUserInterfaceUrl As Uri, customAttributes As String, domainServiceId As Guid)// You can use this method in JavaScript.
- dwFlags
- unsigned int UInt32 UInt32 UInt32
Reserved. Set to 0.
- contentKeyIds
- PlatForm::Guid[] Guid[] Guid[] Guid[]
Identifiers of the content encryption keys.
- contentKeyIdStrings
- PlatForm::String[] String[] String[] String[]
String representations of the content keys. Each string must be a Base-64 encoded 16 byte value.
- contentEncryptionAlgorithm
- PlayReadyEncryptionAlgorithm PlayReadyEncryptionAlgorithm PlayReadyEncryptionAlgorithm PlayReadyEncryptionAlgorithm
Encryption algorithm type used to encrypt the content.
- licenseAcquisitionUrl
- Uri Uri Uri Uri
The URL for the silent (no user interaction) license acquisition Web service.
- licenseAcquisitionUserInterfaceUrl
- Uri Uri Uri Uri
The URL for a non-silent license acquisition Web page.
- customAttributes
- PlatForm::String String String String
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
- PlatForm::Guid Guid Guid 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, e.g. picks different content
// or tells user that their system doesn’t support the selected content
}
- See Also
-
PlayReadyContentHeader(Guid, String, PlayReadyEncryptionAlgorithm, Uri, Uri, String, Guid)PlayReadyContentHeader(Guid, String, PlayReadyEncryptionAlgorithm, Uri, Uri, String, Guid)PlayReadyContentHeader(Guid, String, PlayReadyEncryptionAlgorithm, Uri, Uri, String, Guid)PlayReadyContentHeader(Guid, String, PlayReadyEncryptionAlgorithm, Uri, Uri, String, Guid)
Properties
CustomAttributes CustomAttributes CustomAttributes CustomAttributes
Gets the custom data used by the content provider.
public : PlatForm::String CustomAttributes { get; }public string CustomAttributes { get; }Public ReadOnly Property CustomAttributes As string// You can use this property in JavaScript.
- Value
- PlatForm::String string string string
The custom data used by the content provider.
Remarks
The content author can add arbitrary XML inside this element. Microsoft code does not act on any data contained inside this element.
DecryptorSetup DecryptorSetup DecryptorSetup DecryptorSetup
Gets the decryptor setup value in the header if it is set.
public : PlayReadyDecryptorSetup DecryptorSetup { get; }public PlayReadyDecryptorSetup DecryptorSetup { get; }Public ReadOnly Property DecryptorSetup As PlayReadyDecryptorSetup// You can use this property in JavaScript.
- Value
- PlayReadyDecryptorSetup PlayReadyDecryptorSetup PlayReadyDecryptorSetup PlayReadyDecryptorSetup
The header's decryptor setup value.
DomainServiceId DomainServiceId DomainServiceId DomainServiceId
Gets the domain service identifier in the header if it is set.
public : PlatForm::Guid DomainServiceId { get; }public Guid DomainServiceId { get; }Public ReadOnly Property DomainServiceId As Guid// You can use this property in JavaScript.
- Value
- PlatForm::Guid Guid Guid Guid
The header's domain service identifier. This property value 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.
EncryptionType EncryptionType EncryptionType EncryptionType
Gets the content encryption type in the header if it is set.
public : PlayReadyEncryptionAlgorithm EncryptionType { get; }public PlayReadyEncryptionAlgorithm EncryptionType { get; }Public ReadOnly Property EncryptionType As PlayReadyEncryptionAlgorithm// You can use this property in JavaScript.
- Value
- PlayReadyEncryptionAlgorithm PlayReadyEncryptionAlgorithm PlayReadyEncryptionAlgorithm PlayReadyEncryptionAlgorithm
The header's content encryption type.
HeaderWithEmbeddedUpdates HeaderWithEmbeddedUpdates HeaderWithEmbeddedUpdates HeaderWithEmbeddedUpdates
Gets a new content header that contains any embedded license updates that were available.
public : PlayReadyContentHeader HeaderWithEmbeddedUpdates { get; }public PlayReadyContentHeader HeaderWithEmbeddedUpdates { get; }Public ReadOnly Property HeaderWithEmbeddedUpdates As PlayReadyContentHeader// You can use this property in JavaScript.
The new content header. If updates were not available, then this property returns NULL.
KeyId KeyId KeyId KeyId
Gets the content key identifier value if it is set.
public : PlatForm::Guid KeyId { get; }public Guid KeyId { get; }Public ReadOnly Property KeyId As Guid// You can use this property in JavaScript.
- Value
- PlatForm::Guid Guid Guid Guid
The content key identifier. This property value 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.
KeyIds KeyIds KeyIds KeyIds
Gets the content key identifier values if they are set.
public : PlatForm::Guid[] KeyIds { get; }public Guid[] KeyIds { get; }Public ReadOnly Property KeyIds As Guid[]// You can use this property in JavaScript.
- Value
- PlatForm::Guid[] Guid[] Guid[] Guid[]
The content key identifier values. This property value 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.
KeyIdString KeyIdString KeyIdString KeyIdString
Gets the content key identifier string value if it is set.
public : PlatForm::String KeyIdString { get; }public string KeyIdString { get; }Public ReadOnly Property KeyIdString As string// You can use this property in JavaScript.
- Value
- PlatForm::String string string string
The content key identifier string.
Remarks
This property returns the KeyId value as a string. In most cases this value is a Base-64 encoding of the GUID KeyId. In some situations this value may be a non-GUID conforming string that is used for compatibility with Windows Media Digital Rights Management (WMDRM).
KeyIdStrings KeyIdStrings KeyIdStrings KeyIdStrings
Gets the content key identifier string values if they are set.
public : PlatForm::String[] KeyIdStrings { get; }public string[] KeyIdStrings { get; }Public ReadOnly Property KeyIdStrings As string[]// You can use this property in JavaScript.
- Value
- PlatForm::String[] string[] string[] string[]
The content key identifier string values.
Remarks
This property returns the KeyId values as strings. In most cases these are a Base-64 encodings of the GUID KeyIds. In some situations they may be non-GUID conforming strings that for compatibility with WMDRM. The non-GUID case will never occur when more than one key identifier is present.
LicenseAcquisitionUrl LicenseAcquisitionUrl LicenseAcquisitionUrl LicenseAcquisitionUrl
Gets the license acquisition URL in the header if it is set.
public : Uri LicenseAcquisitionUrl { get; }public Uri LicenseAcquisitionUrl { get; }Public ReadOnly Property LicenseAcquisitionUrl As Uri// You can use this property in JavaScript.
- Value
- Uri Uri Uri Uri
The license acquisition URL.
LicenseAcquisitionUserInterfaceUrl LicenseAcquisitionUserInterfaceUrl LicenseAcquisitionUserInterfaceUrl LicenseAcquisitionUserInterfaceUrl
Gets the license acquisition user interface URL in the header if it is set.
public : Uri LicenseAcquisitionUserInterfaceUrl { get; }public Uri LicenseAcquisitionUserInterfaceUrl { get; }Public ReadOnly Property LicenseAcquisitionUserInterfaceUrl As Uri// You can use this property in JavaScript.
- Value
- Uri Uri Uri Uri
The license acquisition user interface URL.
Methods
GetSerializedHeader() GetSerializedHeader() GetSerializedHeader() GetSerializedHeader()
Retrieves the full PlayReady object as a byte array.
public : byte[] GetSerializedHeader()public byte[] GetSerializedHeader()Public Function GetSerializedHeader() As byte[]// You can use this method in JavaScript.
The header containing the full PlayReady object.