SecureEnvironment SecureEnvironment SecureEnvironment SecureEnvironment Class

Definición

Representa una sesión de cliente segura para la activación de usuario, el enlace de licencias y otras operaciones de administración de derechos.Represents a secure client session for user activation, license binding, and other rights management operations.

public ref class SecureEnvironment : IDisposable
[System.Security.SecurityCritical(System.Security.SecurityCriticalScope.Everything)]
public class SecureEnvironment : IDisposable
type SecureEnvironment = class
    interface IDisposable
Public Class SecureEnvironment
Implements IDisposable
Herencia
SecureEnvironmentSecureEnvironmentSecureEnvironmentSecureEnvironment
Atributos
Implementaciones

Ejemplos

El ejemplo siguiente muestra el uso de la SecureEnvironment claseThe following example shows use of the SecureEnvironment class

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);
    }
}
Dim applicationManifest As String = "<manifest></manifest>"
If File.Exists("rpc.xml") Then
	Dim manifestReader As StreamReader = File.OpenText("rpc.xml")
	applicationManifest = manifestReader.ReadToEnd()
End If

If _secureEnv Is Nothing Then
	If SecureEnvironment.IsUserActivated(New ContentUser(_currentUserId, AuthenticationType.Windows)) Then
		_secureEnv = SecureEnvironment.Create(applicationManifest, New ContentUser(_currentUserId, AuthenticationType.Windows))
	Else
		_secureEnv = SecureEnvironment.Create(applicationManifest, AuthenticationType.Windows, UserActivationMode.Permanent)
	End If
End If

Comentarios

Como ocurre con otros System.Security.RightsManagement tipos, SecureEnvironment sólo es útil en aplicaciones de plena confianza.As with other System.Security.RightsManagement types, SecureEnvironment is only usable in full trust applications.

Propiedades

ApplicationManifest ApplicationManifest ApplicationManifest ApplicationManifest

Obtiene el valor ApplicationManifest especificado cuando se creó SecureEnvironment.Gets the ApplicationManifest specified when the SecureEnvironment was created.

User User User User

Obtiene el usuario o el grupo de usuarios especificado cuando se creó SecureEnvironment.Gets the user or user-group specified when the SecureEnvironment was created.

Métodos

Create(String, AuthenticationType, UserActivationMode) Create(String, AuthenticationType, UserActivationMode) Create(String, AuthenticationType, UserActivationMode) Create(String, AuthenticationType, UserActivationMode)

Crea una sesión de cliente segura dado un manifiesto de derechos de aplicación, AuthenticationType y UserActivationMode.Creates a secure client session given an application rights manifest, AuthenticationType, and UserActivationMode.

Create(String, ContentUser) Create(String, ContentUser) Create(String, ContentUser) Create(String, ContentUser)

Crea una sesión de cliente segura para un usuario especificado con un determinado manifiesto de derechos.Creates a secure client session for a specified user with a given rights manifest.

Dispose() Dispose() Dispose() Dispose()

Libera todos los recursos que usa SecureEnvironment.Releases all resources used by the SecureEnvironment.

Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

Libera los recursos no administrados que usa SecureEnvironment y, de forma opcional, libera los recursos administrados.Releases the unmanaged resources used by the SecureEnvironment and optionally releases the managed resources.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determina si el objeto especificado es igual al objeto actual.Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetActivatedUsers() GetActivatedUsers() GetActivatedUsers() GetActivatedUsers()

Devuelve una lista de los usuarios activados.Returns a list of the activated users.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Sirve como la función hash predeterminada.Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Obtiene el Type de la instancia actual.Gets the Type of the current instance.

(Inherited from Object)
IsUserActivated(ContentUser) IsUserActivated(ContentUser) IsUserActivated(ContentUser) IsUserActivated(ContentUser)

Indica si se activó un usuario determinado para tener acceso al contenido con derechos administrados.Indicates whether a given user has been activated for accessing rights managed content.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Crea una copia superficial del objeto Object actual.Creates a shallow copy of the current Object.

(Inherited from Object)
RemoveActivatedUser(ContentUser) RemoveActivatedUser(ContentUser) RemoveActivatedUser(ContentUser) RemoveActivatedUser(ContentUser)

Quita la activación de licencia de un usuario especificado.Removes the license activation for a specified user.

ToString() ToString() ToString() ToString()

Devuelve una cadena que representa el objeto actual.Returns a string that represents the current object.

(Inherited from Object)

Se aplica a