Language

SecureEnvironment.Create メソッド

定義

権限管理操作用のセキュリティで保護されたクライアント セッションを作成します。

オーバーロード

名前 説明
Create(String, ContentUser)

特定の権限マニフェストを使用して、指定したユーザーのセキュリティで保護されたクライアント セッションを作成します。

Create(String, AuthenticationType, UserActivationMode)

アプリケーション権限マニフェスト、 AuthenticationType、および UserActivationModeを指定して、セキュリティで保護されたクライアント セッションを作成します。

例

次の例は、この方法を使用してセキュリティで保護された環境を作成する方法を示しています。

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)

特定の権限マニフェストを使用して、指定したユーザーのセキュリティで保護されたクライアント セッションを作成します。

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

パラメーター

applicationManifest
String

アプリケーション権限マニフェスト。

user
ContentUser

権限が管理されたコンテンツへのアクセスを許可するユーザーまたはユーザー グループ。

返品

ライセンス認証、ライセンス バインド、およびその他の権限管理操作のためのセキュリティで保護されたクライアント セッション。

例

次の例は、この方法を使用してセキュリティで保護された環境を作成する方法を示しています。

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 メソッドは、既にアクティブ化されているユーザー ( GetActivatedUsersから返されたリストで提供されるなど) で使用することを目的としています。 まだアクティブ化されていないユーザーには、代替 Create メソッドを使用します。

こちらもご覧ください

適用対象

Create(String, AuthenticationType, UserActivationMode)

アプリケーション権限マニフェスト、 AuthenticationType、および UserActivationModeを指定して、セキュリティで保護されたクライアント セッションを作成します。

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

パラメーター

applicationManifest
String

アプリケーション権限マニフェスト。

authentication
AuthenticationType

認証の方法。

userActivationMode
UserActivationMode

ユーザー権利アカウント証明書の種類。

返品

ライセンス認証、ライセンス バインド、およびその他の権限管理操作のためのセキュリティで保護されたクライアント セッション。

例

次の例は、この方法を使用してセキュリティで保護された環境を作成する方法を示しています。

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 メソッドは、まだアクティブ化されていない新しいユーザーを対象としています。

新しいユーザーのアクティブ化には、ユーザー証明書とクライアント ライセンス証明書を取得するためのラウンドトリップ サーバー トランザクションが含まれます。

代替 Create メソッドは、ユーザーが既にアクティブ化されている場合に使用できます ( GetActivatedUsersから返されるリストに表示されるなど)。

適用対象