/// <summary>
        /// This function allows an application to examine or exercise the rights on a locally stored license.
        /// </summary>
        public CryptoProvider Bind(SecureEnvironment secureEnvironment)
        {
            if (secureEnvironment == null)
            {
                throw new ArgumentNullException("secureEnvironment");
            }

            // The SecureEnvironment constructor makes sure ClientSession cannot be null.
            // Accordingly suppressing preSharp warning about having to validate ClientSession.
#pragma warning suppress 6506
            return(secureEnvironment.ClientSession.TryBindUseLicenseToAllIdentites(_serializedUseLicense));
        }
        /// <summary>
        ///  This function attempts to acquire a Use License.
        ///  This function suppresses the Windows network authentication dialog box. If the license request is denied
        ///  because the user does not have permission. This function will prevent the network authentication dialog
        ///  box from being displayed. This is useful when attempting to handle license acquisition on a background
        ///  or other non-user interface thread because you can avoid potentially confusing dialog boxes. If authentication
        ///  does fail, the function will throw an appropriate RightsManagementException
        /// </summary>
        public UseLicense AcquireUseLicenseNoUI(SecureEnvironment secureEnvironment)
        {
            if (secureEnvironment == null)
            {
                throw new ArgumentNullException("secureEnvironment");
            }

            // The SecureEnvironment constructor makes sure ClientSession cannot be null.
            // Accordingly suppressing preSharp warning about having to validate ClientSession.
#pragma warning suppress 6506
            return(secureEnvironment.ClientSession.AcquireUseLicense(_serializedPublishLicense, true));
        }
示例#3
0
        /// <summary>
        ///  This function attempts to acquire a Use License.
        /// </summary>
        public UseLicense AcquireUseLicense(SecureEnvironment secureEnvironment)
        {
            SecurityHelper.DemandRightsManagementPermission();

            if (secureEnvironment == null)
            {
                throw new ArgumentNullException("secureEnvironment");
            }

            // The SecureEnvironment constructor makes sure ClientSession cannot be null.
            // Accordingly suppressing preSharp warning about having to validate ClientSession.
#pragma warning suppress 6506
            return(secureEnvironment.ClientSession.AcquireUseLicense(_serializedPublishLicense, false));
        }
示例#4
0
        /// <summary>
        /// This functions signs the Publish License offline, and as a result produces 2 objects. It makes an instance of the  PublishLicense
        /// and it also builds an instance of the UseLicense, which represeents the authors UseLicense
        /// </summary>
        public PublishLicense Sign(SecureEnvironment secureEnvironment, out UseLicense authorUseLicense)
        {
            SecurityHelper.DemandRightsManagementPermission();

            if (secureEnvironment == null)
            {
                throw new ArgumentNullException("secureEnvironment");
            }

            // in case owner wasn't specified we can just assume default owner
            // based on the user identity that was used to build the secure environment
            ContentUser contentOwner;

            if (_owner != null)
            {
                contentOwner = _owner;
            }
            else
            {
                contentOwner = secureEnvironment.User;
            }

            using (IssuanceLicense issuanceLicense = new IssuanceLicense(
                       DateTime.MinValue,                   // validFrom, - default
                       DateTime.MaxValue,                   // validUntil, - default
                       _referralInfoName,
                       _referralInfoUri,
                       contentOwner,
                       null,
                       SafeRightsManagementHandle.InvalidHandle,                      // boundLicenseHandle,
                       _contentId,
                       Grants,
                       LocalizedNameDescriptionDictionary,
                       ApplicationSpecificDataDictionary,
                       _rightValidityIntervalDays,
                       _revocationPoint))
            {
                // The SecureEnvironment constructor makes sure ClientSession cannot be null.
                // Accordingly suppressing preSharp warning about having to validate ClientSession.
#pragma warning suppress 6506
                return(secureEnvironment.ClientSession.SignIssuanceLicense(issuanceLicense, out authorUseLicense));
            }
        }
 public CryptoProvider Bind(SecureEnvironment secureEnvironment)
 {
     throw new NotImplementedException ();
 }
 public UseLicense AcquireUseLicenseNoUI(SecureEnvironment secureEnvironment)
 {
     throw new NotImplementedException ();
 }
示例#7
0
 public CryptoProvider Bind(SecureEnvironment secureEnvironment)
 {
     throw new NotImplementedException();
 }
示例#8
0
        /// <summary>
        /// This functions signs the Publish License offline, and as a result produces 2 objects. It makes an instance of the  PublishLicense 
        /// and it also builds an instance of the UseLicense, which represeents the authors UseLicense 
        /// </summary>
        public PublishLicense Sign(SecureEnvironment secureEnvironment, out UseLicense authorUseLicense)
        {
            SecurityHelper.DemandRightsManagementPermission();

            if (secureEnvironment == null)
            {
                throw new ArgumentNullException("secureEnvironment");
            }

            // in case owner wasn't specified we can just assume default owner 
            // based on the user identity that was used to build the secure environment
            ContentUser contentOwner;

            if (_owner != null)
            {
                contentOwner = _owner; 
            }
            else
            {
                contentOwner = secureEnvironment.User;
            }

            using(IssuanceLicense issuanceLicense = new IssuanceLicense(
                                        DateTime.MinValue,  // validFrom, - default 
                                        DateTime.MaxValue,  // validUntil, - default 
                                        _referralInfoName,
                                        _referralInfoUri,
                                        contentOwner,
                                        null,
                                        SafeRightsManagementHandle.InvalidHandle,     // boundLicenseHandle,
                                        _contentId,
                                        Grants,
                                        LocalizedNameDescriptionDictionary,
                                        ApplicationSpecificDataDictionary,
                                        _rightValidityIntervalDays,
                                        _revocationPoint))
            {
                // The SecureEnvironment constructor makes sure ClientSession cannot be null.
                // Accordingly suppressing preSharp warning about having to validate ClientSession.
#pragma warning suppress 6506
                return secureEnvironment.ClientSession.SignIssuanceLicense(issuanceLicense, out authorUseLicense);
            }
        }
示例#9
0
 public UseLicense AcquireUseLicenseNoUI(SecureEnvironment secureEnvironment)
 {
     throw new NotImplementedException();
 }
        /// <summary>
        ///  This function attempts to acquire a Use License. 
        ///  This function suppresses the Windows network authentication dialog box. If the license request is denied
        ///  because the user does not have permission. This function will prevent the network authentication dialog 
        ///  box from being displayed. This is useful when attempting to handle license acquisition on a background 
        ///  or other non-user interface thread because you can avoid potentially confusing dialog boxes. If authentication 
        ///  does fail, the function will throw an appropriate RightsManagementException
        /// </summary>
        public UseLicense AcquireUseLicenseNoUI(SecureEnvironment secureEnvironment)
        {
            SecurityHelper.DemandRightsManagementPermission();
                    
            if (secureEnvironment == null)
            {
                throw new ArgumentNullException("secureEnvironment");
            }

            // The SecureEnvironment constructor makes sure ClientSession cannot be null.
            // Accordingly suppressing preSharp warning about having to validate ClientSession.
#pragma warning suppress 6506
            return secureEnvironment.ClientSession.AcquireUseLicense(_serializedPublishLicense, true);
        }        
示例#11
0
        /// <summary>
        /// This function allows an application to examine or exercise the rights on a locally stored license.
        /// </summary>
        public CryptoProvider Bind (SecureEnvironment secureEnvironment)
        {
            SecurityHelper.DemandRightsManagementPermission();

            if (secureEnvironment == null)
            {
                throw new ArgumentNullException("secureEnvironment");
            }

            // The SecureEnvironment constructor makes sure ClientSession cannot be null.
            // Accordingly suppressing preSharp warning about having to validate ClientSession.
#pragma warning suppress 6506
            return secureEnvironment.ClientSession.TryBindUseLicenseToAllIdentites(_serializedUseLicense);
        }
示例#12
0
 public PublishLicense Sign(SecureEnvironment secureEnvironment, out UseLicense authorUseLicense)
 {
     throw new NotImplementedException();
 }
示例#13
0
		public PublishLicense Sign (SecureEnvironment secureEnvironment, out UseLicense authorUseLicense)
		{
			throw new NotImplementedException ();
		}