CryptoProvider.BoundGrants Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets a collection listing the rights that passed verification and that are granted to the user.

Namespace:   System.Security.RightsManagement
Assembly:  WindowsBase (in WindowsBase.dll)

public ReadOnlyCollection<ContentGrant> BoundGrants { get; }

Property Value

Type: System.Collections.ObjectModel.ReadOnlyCollection<ContentGrant>

A collection enumerating the rights that passed verification and that are granted to the user.

The following example shows how to use the BoundGrants property to obtain a list rights granted through a UseLicense.

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

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

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.");
    ShowStatus("   CANNOT DECRYPT!");

.NET Framework
Available since 3.0
Return to top