Export (0) Print
Expand All

SecureEnvironment Class

Represents a secure client session for user activation, license binding, and other rights management operations.

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

public class SecureEnvironment : IDisposable
public class SecureEnvironment implements IDisposable
public class SecureEnvironment implements IDisposable
You cannot use this managed class in XAML.

As with other System.Security.RightsManagement types, SecureEnvironment is only usable in full trust applications.

The following example shows use of the SecureEnvironment class. For the full sample, see Rights Managed Package Publish Sample.

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);
    }
}

System.Object
  System.Security.RightsManagement.SecureEnvironment

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2014 Microsoft