Share via


IWMDRMProfile.Update

Windows Media Encoder SDK banner art

The Update method saves updated DRM profile settings to the system.

Syntax

void IWMDRMProfile.Update();

Parameters

This method takes no parameters.

Return Values

This method does not return a value.

Example Code

using WMEncoderLib;

try 
{
// Create a WMEncoder object.
  WMEncoder Encoder;
  Encoder = new WMEncoder();

// Create an IWMDRMContentAuthor object.
  IWMDRMContentAuthor DRM;
  DRM = Encoder.EncoderDRMContentAuthor;

// Retrieve the collection of DRM profiles.
  IWMDRMProfileCollection DRMProColl;
  DRMProColl = DRM.DRMProfileCollection;

// Declare variables and specify the provider's Web site.
  string sPublicKey;
  string sWebURL;
  object vProfileID;
  object vSeed;
  sWebURL = "https://YourWebSite";
  string sSigPrivKey;
  string sSignedPubKey;
  string sSigLSCert;
  string sSigRootCert;
  sSigPrivKey = "Replace with signature private key";
  sSignedPubKey = "Replace with signed public key";
  sSigLSCert = "Replace with the licensor certificate";
  sSigRootCert = "Replace with the Microsoft DRM License Server Root certificate";

// Create the DRM profile. The public key, DRM profile ID, and
// license key seed are returned.
  sPublicKey = DRM.CreateDRMProfile(sWebURL, sSigPrivKey, sSignedPubKey, sSigLSCert, sSigRootCert, out vProfileID, out vSeed);

// Create an IWMDRMProfile object. Assuming the new profile is the only one
// in the collection, retrieve the DRM profile with item index = 0.
  IWMDRMProfile DRMPro;
  DRMPro = DRMProColl.Item(0);

// Set the rest of the properties for the DRM profile.
  DRMPro.Description = "Replace with a description of this DRM profile";
  DRMPro.LicenseAcquisitionURL = "Replace with v7 license acquisition URL";
  DRMPro.Name = "Replace with a name for the DRM profile";
  DRMPro.V1LicenseAcquisitionURL = "Replace with v1 license acquisition URL";

// Add the individualization version as an attribute. 
// This attribute should be saved in the DRM profile. 
  IWMDRMAttributes ProAttr = DRMPro.Attributes;
  ProAttr.Add("SECURITYVERSION", "2.2");

// Update the profile information.
  DRMPro.Update();
}

catch (Exception e)
{
     // TODO: Handle exceptions.
}

Requirements

Reference: Windows Media Encoder

Namespace: WMEncoderLib

Assembly: Interop.WMEncoderLib.dll

Library: WMEncoderLib.dll

See Also