RightsManagementInformation::SaveUseLicense Method (ContentUser^, UseLicense^)

 

Saves a given UseLicense for a specified user to the encrypted rights management data stream.

Namespace:   System.IO.Packaging
Assembly:  WindowsBase (in WindowsBase.dll)

public:
void SaveUseLicense(
	ContentUser^ userKey,
	UseLicense^ useLicense
)

Parameters

userKey
Type: System.Security.RightsManagement::ContentUser^

The user of the UseLicense.

useLicense
Type: System.Security.RightsManagement::UseLicense^

The use license to store and embed in the package.

Exception Condition
ArgumentNullException

Either the userKey or useLicense parameter is null.

FileFormatException

The rights management information in this package cannot be read by the current version of this class.

After the UseLicense for the specified user has been saved, it can be retrieved through the LoadUseLicense method and from the collection returned by GetEmbeddedUseLicenses.

A Package can store the UseLicense rights information for multiple content users. Each ContentUser can have at most one UseLicense. If SaveUseLicense is called to store a new UseLicense for a ContentUser that already has a UseLicense, the previous license will be overwritten with the new license.

The following example shows how to use of the SaveUseLicense method.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 3.0
Return to top
Show: