SecureEnvironment.Create Yöntem

Tanım

Hak yönetimi işlemleri için güvenli bir istemci oturumu oluşturur.

Aşırı Yüklemeler

Name Description
Create(String, ContentUser)

Belirli bir hak bildirimine sahip belirli bir kullanıcı için güvenli bir istemci oturumu oluşturur.

Create(String, AuthenticationType, UserActivationMode)

ve bir uygulama hakları bildirimi AuthenticationTypeUserActivationModeverilip güvenli bir istemci oturumu oluşturur.

Örnekler

Aşağıdaki örnekte, güvenli bir ortam oluşturmak için bu yöntemin nasıl kullanılacağı gösterilmektedir.

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

Create(String, ContentUser)

Belirli bir hak bildirimine sahip belirli bir kullanıcı için güvenli bir istemci oturumu oluşturur.

public:
 static System::Security::RightsManagement::SecureEnvironment ^ Create(System::String ^ applicationManifest, System::Security::RightsManagement::ContentUser ^ user);
public static System.Security.RightsManagement.SecureEnvironment Create(string applicationManifest, System.Security.RightsManagement.ContentUser user);
static member Create : string * System.Security.RightsManagement.ContentUser -> System.Security.RightsManagement.SecureEnvironment
Public Shared Function Create (applicationManifest As String, user As ContentUser) As SecureEnvironment

Parametreler

applicationManifest
String

Uygulama hakları bildirimi.

user
ContentUser

Hakları yönetilen içeriğe erişim vermek için kullanıcı veya kullanıcı grubu.

Döndürülenler

Etkinleştirme, lisans bağlama ve diğer hak yönetimi işlemleri için güvenli bir istemci oturumu.

Örnekler

Aşağıdaki örnekte, güvenli bir ortam oluşturmak için bu yöntemin nasıl kullanılacağı gösterilmektedir.

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

Açıklamalar

Bu Create yöntem, 'den GetActivatedUsersdöndürülen listede sağlanmış gibi, zaten etkinleştirilmiş kullanıcılarla kullanıma yöneliktir. Henüz etkinleştirilmemiş kullanıcılar için alternatif Create yöntemi kullanın.

Ayrıca bkz.

Şunlara uygulanır

Create(String, AuthenticationType, UserActivationMode)

ve bir uygulama hakları bildirimi AuthenticationTypeUserActivationModeverilip güvenli bir istemci oturumu oluşturur.

public:
 static System::Security::RightsManagement::SecureEnvironment ^ Create(System::String ^ applicationManifest, System::Security::RightsManagement::AuthenticationType authentication, System::Security::RightsManagement::UserActivationMode userActivationMode);
public static System.Security.RightsManagement.SecureEnvironment Create(string applicationManifest, System.Security.RightsManagement.AuthenticationType authentication, System.Security.RightsManagement.UserActivationMode userActivationMode);
static member Create : string * System.Security.RightsManagement.AuthenticationType * System.Security.RightsManagement.UserActivationMode -> System.Security.RightsManagement.SecureEnvironment
Public Shared Function Create (applicationManifest As String, authentication As AuthenticationType, userActivationMode As UserActivationMode) As SecureEnvironment

Parametreler

applicationManifest
String

Uygulama hakları bildirimi.

authentication
AuthenticationType

Kimlik doğrulama yöntemi.

userActivationMode
UserActivationMode

Kullanıcı hakları hesabı sertifikasının türü.

Döndürülenler

Etkinleştirme, lisans bağlama ve diğer hak yönetimi işlemleri için güvenli bir istemci oturumu.

Örnekler

Aşağıdaki örnekte, güvenli bir ortam oluşturmak için bu yöntemin nasıl kullanılacağı gösterilmektedir.

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

Açıklamalar

Bu Create yöntem henüz etkinleştirilmemiş yeni kullanıcılara yöneliktir.

Yeni bir kullanıcının etkinleştirilmesi, Kullanıcı Sertifikası ve İstemci Lisans Sertifikası almak için bir gidiş dönüş sunucusu işlemi içerir.

Alternatif Create yöntem, bir kullanıcı zaten etkinleştirilmişse ( örneğin, içinden GetActivatedUsersdöndürülen listede sağlanmıştır) kullanılabilir.

Şunlara uygulanır