Edit

Share via


Verification and Initialization

[The feature associated with this page, Windows Media Format 11 SDK, is a legacy feature. It has been superseded by Source Reader and Sink Writer. Source Reader and Sink Writer have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use Source Reader and Sink Writer instead of Windows Media Format 11 SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

You should perform the following steps to verify that transcryption is allowed and to initialize an object that will decrypt the content:

  1. If you already have the Key ID for the content, skip to step 5.
  2. Call the WMCreateEditor function to create a metadata editor object and get an instance of that object's IWMMetadataEditor interface.
  3. Call IWMMetadataEditor::QueryInterface to get an instance of the IWMDRMEditor interface.
  4. Call IWMDRMEditor::GetDRMProperty to get the DRM_DRMHeader_KeyID property.
  5. Initialize the Windows Media DRM Client Extended APIs by calling the WMDRMStartup function.
  6. Call the WMDRMCreateProtectedProvider function to create a secure provider object and get an instance of that object's IWMDRMProvider interface.
  7. Call IWMDRMProvider::CreateObject to create a license management object and get an instance of its IWMDRMLicenseManagement interface.
  8. Call IWMDRMLicenseManagement::CreateLicenseEnumeration, passing in the Key ID and the right that governs the actions to be taken with the content after it is transcrypted. This call will retrieve an instance of the IWMDRMLicense interface that can be used to enumerate through any matching licenses.
  9. Call IWMDRMLicense::GetInclusionList to retrieve the list of authorized content protection systems (CPS) as specified by the license issuer.
  10. Parse the inclusion list to confirm that the GUID of the output CPS is allowed by the license.
  11. If the desired export GUID is not in the inclusion list, call IWMDRMLicense::GetNext to get the next applicable license (if any) and repeat steps 9 and 10. If no license has the desired GUID in its inclusion list, the export cannot be performed.
  12. Call IWMDRMLicense::CreateSecureDecryptor to create a decryptor object. Pass in the export application certificate. This call will provide a pointer to an instance of the decryptor object's IWMDRMDecrypt interface and a binary object containing the seed. Only the Windows Media DRM_PROTECTION_TYPE_RC4 constant is supported as an argument to the dwFlags parameter at this time.
  13. Use the RSA OAEP encryption scheme to decrypt the initialization vector.
  14. Use the ASF parsing library provided by Microsoft when you enter into the Windows Media DRM export agreement, to locate the offset in bytes for each payload.

Exporting Compressed Content