RightsManagementInformation RightsManagementInformation RightsManagementInformation RightsManagementInformation Class

정의

EncryptedPackageEnvelope에 저장되어 있는 DRM(디지털 권한 관리) 정보를 나타냅니다.Represents Digital Rights Management (DRM) information that is stored in an EncryptedPackageEnvelope.

public ref class RightsManagementInformation
public class RightsManagementInformation
type RightsManagementInformation = class
Public Class RightsManagementInformation
상속
RightsManagementInformationRightsManagementInformationRightsManagementInformationRightsManagementInformation

예제

다음 예제에서는 초기화 하는 방법을 보여 줍니다는 RightsManagementInformation 암호화에 대 한 개체입니다.The following example shows how to initialize a RightsManagementInformation object for encryption.

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

다음 예제에서는 초기화 하는 방법을 보여 줍니다는 RightsManagementInformation 암호 해독에 대 한 개체입니다.The following example shows how to initialize a RightsManagementInformation object for decryption.

ShowStatus("   Opening the encrypted Package.");
EncryptedPackageEnvelope ePackage =
    EncryptedPackageEnvelope.Open(xpsFile, FileAccess.ReadWrite);
RightsManagementInformation rmi =
    ePackage.RightsManagementInformation;

ShowStatus("   Looking for an embedded UseLicense for user:\n       " +
           currentUserId + " [" + _authentication + "]");
UseLicense useLicense =
    rmi.LoadUseLicense(
        new ContentUser(currentUserId, _authentication));

ReadOnlyCollection<ContentGrant> grants;
if (useLicense == null)
{
    ShowStatus("   No Embedded UseLicense found.\n       " +
               "Attempting to acqure UseLicnese\n       " +
               "from the PublishLicense.");
    PublishLicense pubLicense = rmi.LoadPublishLicense();

    ShowStatus("   Referral information:");

    if (pubLicense.ReferralInfoName == null)
        ShowStatus("       Name: (null)");
    else
        ShowStatus("       Name: " + pubLicense.ReferralInfoName);

    if (pubLicense.ReferralInfoUri == null)
        ShowStatus("    Uri: (null)");
    else
        ShowStatus("    Uri: " +
            pubLicense.ReferralInfoUri.ToString());

    useLicense = pubLicense.AcquireUseLicense(_secureEnv);
    if (useLicense == null)
    {
        ShowStatus("   User DOES NOT HAVE RIGHTS\n       " +
            "to access this document!");
        return false;
    }
}// end:if (useLicense == null)
ShowStatus("   UseLicense acquired.");
ShowStatus("   Opening the encrypted Package.")
Dim ePackage As EncryptedPackageEnvelope = EncryptedPackageEnvelope.Open(xpsFile, FileAccess.ReadWrite)
Dim rmi As RightsManagementInformation = ePackage.RightsManagementInformation

ShowStatus("   Looking for an embedded UseLicense for user:" & vbLf & "       " & currentUserId & " [" & _authentication & "]")
Dim useLicense As UseLicense = rmi.LoadUseLicense(New ContentUser(currentUserId, _authentication))

Dim grants As ReadOnlyCollection(Of ContentGrant)
If useLicense Is Nothing Then
	ShowStatus("   No Embedded UseLicense found." & vbLf & "       " & "Attempting to acqure UseLicnese" & vbLf & "       " & "from the PublishLicense.")
	Dim pubLicense As PublishLicense = rmi.LoadPublishLicense()

	ShowStatus("   Referral information:")

	If pubLicense.ReferralInfoName Is Nothing Then
		ShowStatus("       Name: (null)")
	Else
		ShowStatus("       Name: " & pubLicense.ReferralInfoName)
	End If

	If pubLicense.ReferralInfoUri Is Nothing Then
		ShowStatus("    Uri: (null)")
	Else
		ShowStatus("    Uri: " & pubLicense.ReferralInfoUri.ToString())
	End If

	useLicense = pubLicense.AcquireUseLicense(_secureEnv)
	If useLicense Is Nothing Then
		ShowStatus("   User DOES NOT HAVE RIGHTS" & vbLf & "       " & "to access this document!")
		Return False
	End If
End If ' end:if (useLicense == null)
ShowStatus("   UseLicense acquired.")

설명

RightsManagementInformation 에 대 한 액세스를 제공 합니다 PublishLicenseUseLicense rights에 저장 된 데이터 보호 관리 Package합니다.RightsManagementInformation provides access to the PublishLicense and UseLicense data stored in a rights managed protected Package.

속성

CryptoProvider CryptoProvider CryptoProvider CryptoProvider

패키지의 암호화된 권한 관리 데이터 스트림에 액세스하기 위한 CryptoProvider를 가져오거나 설정합니다.Gets or sets the CryptoProvider for accessing the package's encrypted rights management data stream.

메서드

DeleteUseLicense(ContentUser) DeleteUseLicense(ContentUser) DeleteUseLicense(ContentUser) DeleteUseLicense(ContentUser)

암호화된 권한 관리 데이터 스트림에서 지정된 사용자의 UseLicense를 삭제합니다.Deletes the UseLicense for a specified user from the encrypted rights management data stream.

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

지정한 개체와 현재 개체가 같은지 여부를 확인합니다.Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetEmbeddedUseLicenses() GetEmbeddedUseLicenses() GetEmbeddedUseLicenses() GetEmbeddedUseLicenses()

암호화된 권한 관리 데이터 스트림에서 사용자 및 UseLicense 키/값 쌍의 사전 컬렉션을 반환합니다.Returns a dictionary collection of user and UseLicense key/value pairs from the encrypted rights management data stream.

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

기본 해시 함수로 작동합니다.Serves as the default hash function.

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

현재 인스턴스의 Type을 가져옵니다.Gets the Type of the current instance.

(Inherited from Object)
LoadPublishLicense() LoadPublishLicense() LoadPublishLicense() LoadPublishLicense()

암호화된 권한 관리 데이터 스트림에서 포함된 PublishLicense를 반환합니다.Returns the embedded PublishLicense from the encrypted rights management data stream.

LoadUseLicense(ContentUser) LoadUseLicense(ContentUser) LoadUseLicense(ContentUser) LoadUseLicense(ContentUser)

암호화된 권한 관리 데이터 스트림에서 지정된 사용자의 포함된 UseLicense를 반환합니다.Returns a specified user's embedded UseLicense from the encrypted rights management data stream.

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

현재 Object의 단순 복사본을 만듭니다.Creates a shallow copy of the current Object.

(Inherited from Object)
SavePublishLicense(PublishLicense) SavePublishLicense(PublishLicense) SavePublishLicense(PublishLicense) SavePublishLicense(PublishLicense)

지정된 PublishLicense를 암호화된 권한 관리 데이터 스트림에 저장합니다.Saves a given PublishLicense to the encrypted rights management data stream.

SaveUseLicense(ContentUser, UseLicense) SaveUseLicense(ContentUser, UseLicense) SaveUseLicense(ContentUser, UseLicense) SaveUseLicense(ContentUser, UseLicense)

지정된 사용자의 지정된 UseLicense를 암호화된 권한 관리 데이터 스트림에 저장합니다.Saves a given UseLicense for a specified user to the encrypted rights management data stream.

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

현재 개체를 나타내는 문자열을 반환합니다.Returns a string that represents the current object.

(Inherited from Object)

적용 대상

추가 정보