SecureEnvironment.Create 메서드

정의

권한 관리 작업에 대한 보안 클라이언트 세션을 만듭니다.

오버로드

Name Description
Create(String, ContentUser)

지정된 권한 매니페스트를 사용하여 지정된 사용자에 대한 보안 클라이언트 세션을 만듭니다.

Create(String, AuthenticationType, UserActivationMode)

애플리케이션 권한 매니페스트AuthenticationTypeUserActivationMode를 지정하여 보안 클라이언트 세션을 만듭니다.

예제

다음 예제에서는 이 메서드를 사용하여 보안 환경을 만드는 방법을 보여 줍니다.

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)

애플리케이션 권한 매니페스트AuthenticationTypeUserActivationMode를 지정하여 보안 클라이언트 세션을 만듭니다.

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 메서드를 사용할 수 있습니다.

적용 대상