CryptoProvider.CanDecrypt 속성

정의

사용자에게 암호 해독 권한이 있는지 여부를 나타내는 값을 가져옵니다.

public:
 property bool CanDecrypt { bool get(); };
public bool CanDecrypt { get; }
member this.CanDecrypt : bool
Public ReadOnly Property CanDecrypt As Boolean

속성 값

Boolean

true 경우는 UseLicense 암호를 해독할; 사용자 권한 부여이 고, 그렇지 false합니다.

예제

다음 예제에서는 사용 하는 방법의 CanDecrypt 암호화가 허용 되는지 확인 하는 속성입니다.

ShowStatus("   Binding UseLicense with the SecureEnvironment" +
         "\n       to obtain the CryptoProvider.");
CryptoProvider cryptoProvider = useLicense.Bind(_secureEnv);

ShowStatus("   Obtaining BoundGrants.");
ReadOnlyCollection<ContentGrant> grants =
    cryptoProvider.BoundGrants;

rightsBlockTitle.Text = "Rights - " + Filename(useLicenseFile);
rightsBlock.Text = "GRANTS LIST\n-----------------\n";
foreach (ContentGrant grant in grants)
{
    rightsBlock.Text += "USER:  " + grant.User.Name + " [" +
        grant.User.AuthenticationType + "]\n";
    rightsBlock.Text += "RIGHT: " + grant.Right.ToString() + "\n";
    rightsBlock.Text += "    From:  " + grant.ValidFrom + "\n";
    rightsBlock.Text += "    Until: " + grant.ValidUntil + "\n";
}

if (cryptoProvider.CanDecrypt == true)
    ShowStatus("   Decryption granted.");
else
    ShowStatus("   CANNOT DECRYPT!");
ShowStatus("   Binding UseLicense with the SecureEnvironment" & vbLf & "       to obtain the CryptoProvider.")
Dim cryptoProvider As CryptoProvider = useLicense.Bind(_secureEnv)

ShowStatus("   Obtaining BoundGrants.")
Dim grants As ReadOnlyCollection(Of ContentGrant) = cryptoProvider.BoundGrants

rightsBlockTitle.Text = "Rights - " & Filename(useLicenseFile)
rightsBlock.Text = "GRANTS LIST" & vbLf & "-----------------" & vbLf
For Each grant As ContentGrant In grants
    rightsBlock.Text &= "USER:  " & grant.User.Name & " [" & grant.User.AuthenticationType & "]" & vbLf
    rightsBlock.Text &= "RIGHT: " & grant.Right.ToString() & vbLf
    rightsBlock.Text &= "    From:  " & grant.ValidFrom & vbLf
    rightsBlock.Text &= "    Until: " & grant.ValidUntil & vbLf
Next grant

If cryptoProvider.CanDecrypt = True Then
    ShowStatus("   Decryption granted.")
Else
    ShowStatus("   CANNOT DECRYPT!")
End If

설명

CanDecrypt 반환 true 경우는 UseLicense 이 바인딩된 CryptoProvider 사용자 보기, 편집, 인쇄 또는 소유자와 같은 읽기 액세스 권한을 부여 합니다.

적용 대상

추가 정보