UseLicense 클래스

정의

보호된 권한 관리 콘텐츠에 액세스할 수 있게 하는 라이선스를 나타냅니다.

public ref class UseLicense
[System.Security.SecurityCritical(System.Security.SecurityCriticalScope.Everything)]
public class UseLicense
public class UseLicense
[<System.Security.SecurityCritical(System.Security.SecurityCriticalScope.Everything)>]
type UseLicense = class
type UseLicense = class
Public Class UseLicense
상속
UseLicense
특성

예제

다음 예제에서는이 클래스를 사용 하 여 초기화 하는 방법을 보여 줍니다는 PublishLicense합니다.

WriteStatus("   Signing the UnsignedPublishLicense\n" +
            "       to build the PublishLicense.");
UseLicense authorsUseLicense;
PublishLicense publishLicense =
    unsignedLicense.Sign(_secureEnv, out authorsUseLicense);

WriteStatus("   Binding the author's UseLicense and");
WriteStatus("       obtaining the CryptoProvider.");
CryptoProvider cryptoProvider = authorsUseLicense.Bind(_secureEnv);

WriteStatus("   Creating the EncryptedPackage.");
Stream packageStream = File.OpenRead(packageFile);
EncryptedPackageEnvelope ePackage =
    EncryptedPackageEnvelope.CreateFromPackage(encryptedFile,
        packageStream, publishLicense, cryptoProvider);

WriteStatus("   Adding an author's UseLicense.");
RightsManagementInformation rmi =
    ePackage.RightsManagementInformation;
rmi.SaveUseLicense(author, authorsUseLicense);

ePackage.Close();
WriteStatus("   Done - Package encryption complete.");

WriteStatus("Verifying package encryption.");
if (EncryptedPackageEnvelope.IsEncryptedPackageEnvelope(encryptedFile))
{
    WriteStatus("   Confirmed - '" + encryptedFilename +
                "' is encrypted.");
}
else
{
    MessageBox.Show("ERROR: '" + encryptedFilename +
        "' is NOT ENCRYPTED.", "Encryption Error",
        MessageBoxButton.OK, MessageBoxImage.Error);
    WriteStatus("ERROR: '" + encryptedFilename +
                "' is NOT ENCRYPTED.\n");
    return false;
}
WriteStatus("   Signing the UnsignedPublishLicense" & vbLf & "       to build the PublishLicense.")
Dim authorsUseLicense As UseLicense = Nothing
Dim publishLicense As PublishLicense = unsignedLicense.Sign(_secureEnv, authorsUseLicense)

WriteStatus("   Binding the author's UseLicense and")
WriteStatus("       obtaining the CryptoProvider.")
Dim cryptoProvider As CryptoProvider = authorsUseLicense.Bind(_secureEnv)

WriteStatus("   Creating the EncryptedPackage.")
Dim packageStream As Stream = File.OpenRead(packageFile)
Dim ePackage As EncryptedPackageEnvelope = EncryptedPackageEnvelope.CreateFromPackage(encryptedFile, packageStream, publishLicense, cryptoProvider)

WriteStatus("   Adding an author's UseLicense.")
Dim rmi As RightsManagementInformation = ePackage.RightsManagementInformation
rmi.SaveUseLicense(author, authorsUseLicense)

ePackage.Close()
WriteStatus("   Done - Package encryption complete.")

WriteStatus("Verifying package encryption.")
If EncryptedPackageEnvelope.IsEncryptedPackageEnvelope(encryptedFile) Then
    WriteStatus("   Confirmed - '" & encryptedFilename & "' is encrypted.")
Else
    MessageBox.Show("ERROR: '" & encryptedFilename & "' is NOT ENCRYPTED.", "Encryption Error", MessageBoxButton.OK, MessageBoxImage.Error)
    WriteStatus("ERROR: '" & encryptedFilename & "' is NOT ENCRYPTED." & vbLf)
    Return False
End If

설명

다른와 마찬가지로 System.Security.RightsManagement 형식을 UseLicense 완전 신뢰 애플리케이션에만 유용 합니다.

생성자

UseLicense(String)

UseLicense 클래스의 새 인스턴스를 초기화합니다.

속성

ApplicationData

게시하는 애플리케이션에서 사용하는 애플리케이션으로 전달한 키/값 쌍이 들어 있는 애플리케이션 데이터 사전을 가져옵니다.

ContentId

게시자가 만든 콘텐츠 식별자를 가져옵니다.

Owner

라이선스 소유자를 가져옵니다.

메서드

Bind(SecureEnvironment)

지정된 SecureEnvironment에 라이선스를 바인딩합니다.

Equals(Object)

이 라이선스가 지정된 다른 라이선스와 같은지 여부를 나타냅니다.

GetHashCode()

이 라이선스와 연결된 해시 코드를 반환합니다.

GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

이 라이선스를 만드는 데 사용되는 직렬화된 XrML 문자열을 반환합니다.

적용 대상