UserActivationMode Enumeration

 

Specifies the type of user Rights Account Certificate to request for rights management activation.

Namespace:   System.Security.RightsManagement
Assembly:  WindowsBase (in WindowsBase.dll)

public enum UserActivationMode

Member nameDescription
Permanent

A permanent Rights Account Certificate.

Temporary

A temporary Rights Account Certificate.

Used as a parameter to the Create method of a SecureEnvironment, UserActivationMode specifies to request either a Temporary or Permanent Rights Account Certificate.

The following example shows how to use this enumeration to create a SecureEnvironment.

string applicationManifest = "<manifest></manifest>";
if (File.Exists("rpc.xml"))
{
    StreamReader manifestReader = File.OpenText("rpc.xml");
    applicationManifest = manifestReader.ReadToEnd();
}

if (_secureEnv == null)
{
    if (SecureEnvironment.IsUserActivated(new ContentUser(
                _currentUserId, AuthenticationType.Windows)))
    {
        _secureEnv = SecureEnvironment.Create(
            applicationManifest, new ContentUser(
                _currentUserId, AuthenticationType.Windows));
    }
    else
    {
        _secureEnv = SecureEnvironment.Create(
            applicationManifest,
            AuthenticationType.Windows,
            UserActivationMode.Permanent);
    }
}

.NET Framework
Available since 3.0
Return to top
Show: