Share via


Creating a New Unsigned Issuance License

When you plan to republish, you must create a new issuance license that has the updated user and right data for the file to use. Create a new issuance license as described in Creating an Issuance License, using your new data. All data from the old license are deleted, except for the content key. Be sure to add the application-specific data pair "Allow_Server_Editing"/"True" to the license again to allow this license to continue to be republished.

The DRMCreateIssuanceLicense function only gives you a handle to an issuance license, but EditIssuanceLicense takes the old and new issuance licenses as string values (actually, as XmlNode data types, but this type requires the actual issuance license text value). To get your unsigned issuance license as a string, you must call DRMGetSignedIssuanceLicense with the DRM_SERVER_ISSUANCELICENSE flag. This call, with this flag, returns the unsigned issuance license as a string to the callback function.

...
unsafe 
{
   fixed (byte* keyBuffer = bContentKey)
   {
      Nmc.Check(DRMGetSignedIssuanceLicense(
      IntPtr.Zero,
      hIssuanceLicense,
      DRM_SERVER_ISSUANCELICENSE,    // Unsigned issuance license
      (IntPtr)keyBuffer,
      keyLen,
      keyType,
      szChain,
      new MsdrmCallback(RmOnStatus), // Callback delegate
      null,                          // No server URL is needed
      IntPtr.Zero));
   }
}
...

The unsigned issuance license will be returned in the callback code through the pvParam parameter. The following C# example shows the unsigned issuance license being assigned to the public member unSignedPL.

// Public member variable of the containing class.
public string unSignedPL = null;
...
unsafe public void RmOnStatus(DRM_STATUS_MSG msg, 
                              int hr, 
                              IntPtr pvParam, 
                              IntPtr pvContext)
{
...
    if ( msg == DRM_STATUS_MSG.DRM_MSG_SIGN_ISSUANCE_LICENSE && 
        hr  == S_DRM_COMPLETED && 
        pvParam != IntPtr.Zero )
    {
        unSignedPL = Marshal.PtrToStringAuto(pvParam);
    }
...
}

See Also

Updating the Issuance License

Send comments about this topic to Microsoft

Build date: 3/13/2008