授权WPF,Silverlight和WP7程序集 [英] Licensing WPF, Silverlight and WP7 assemblies

查看:73
本文介绍了授权WPF,Silverlight和WP7程序集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种许可WPF,Silverlight和WP7组件的解决方案.所讨论的程序集是一个图表控件,它具有可在平台上使用的单个API.我正在为每个平台(WPF,SL,WP7)创建一个单独的MSI,用户可以下载和安装该MSI.这会将程序集注册到其GAC中以供开发使用.

I am looking for a solution to license a WPF, Silverlight and WP7 assembly. The assembly in question is a chart control which has a single API for use across platforms. I am in the process of creating a separate MSI for each platform (WPF, SL, WP7) which users will be able to download and install. This will register the assemblies in their GAC for development use.

我想做的是确保单个开发许可证仅由单个开发人员使用.它不必是超级安全的,仅足以阻止可能的黑客.理想情况下,涵盖所有三个平台的解决方案将是有益的.

What I would like to do is ensure that a single development license is only used by a single developer. It doesn't have to be super secure, just enough to deter would-be hackers. Ideally a solution that covered all three platforms would be beneficial.

我已经有一个跨平台的混淆器,我对此感到非常满意.可惜这不包括许可!

I already have a cross-platform obfuscator which I am very pleased with. Shame this doesn't include licensing!

附加要求是,我将允许用户从购买日期开始下载长达一年的更新,但是无论他们是否更新,他们购买的程序集都将无限期可用.程序集将被重新分发,因此任何许可模式都必须在WPF/SL/WP7平台上重新分发.

Additional requirements are that I will be allowing users to download updates for up to one year from purchase date, however the assemblies they purchase will be available for their use indefinitely whether or not they update. Assemblies are to be redistributed so any licensing model must be redistributable on WPF/SL/WP7 platforms.

欢迎您提出建议/意见.

Your suggestions / comments welcome.

最诚挚的问候

推荐答案

对于您的许可方法要求将完成任务"并防止低级许可滥用"的要求,我个人建议不要太花哨.也就是说,避免使用网络激活/维护的许可.我的建议类似于此处 .

For your requirements that the licencing methodology 'will "do the job" and prevent low-level licence abuse' I would personally recommend not getting too fancy; that is, to avoid the use of web-activated/maintained licencing. My advice would be similar to the approach outlined here.

  1. 使用上面链接中所述的.NET库之一选择对称加密算法.
  2. 使用随机生成器创建所需的加密密钥(如果您与我联系,我很乐意分享一段我开发的代码,以生成用于任何所需密钥大小的各种随机字符串/密钥),还有.NET类通过生成伪随机数(RNGCryptoServiceProvider)帮助您自己完成此操作.
  3. 转换/自定义哈希"密钥以提供新的哈希加密密钥".
  4. 使用此密钥生成初始化向量(IV)并加密您的许可证文件.
  1. Select a symmetric encryption algorithm using the one of the .NET libraries as described in the link above.
  2. Create the required encryption key using a random generator (if you contact me I am happy to share a piece of code I developed to generate a variety of random strings/keys for any required key size), there are also .NET classes to help you do this yourself by generating pseudo-random numbers (RNGCryptoServiceProvider).
  3. Transform/’custom-hash’ the key to provide a new 'hashed encryption key'.
  4. Use this key to generate an Initialisation Vector (IV) and encrypt your licence file.

您现在可以决定如何部署应用程序(就许可而言).以下两种方法将适用于上述所有三种应用程序类型,并且将为每种产品的许可提供一定程度的一致性.上面的方法使用两个文件进行许可. "ProductKey.myExtension"和"LicenceFile.myOtherExtension".第一个包含随机生成的密钥,该密钥将以与许可证生成器应用程序中相同的方式散列"/转换(您将需要一个单独的(小型)应用程序来剪切"/创建许可证文件).第二个是带有用户信息,许可期限等的加密文件.

How you now deploy the application (in terms of licencing) is up to you. The two methods below will work for all three application types above and will offer some degree of consistency for the licencing of each of your products. The above method uses two files for licencing. 'ProductKey.myExtension' and 'LicenceFile.myOtherExtension'. The first contains the randomly generated key, that will be 'hashed'/transformed in the same way as in the licence generator application (you will need a separate (small) application to ‘cut’/create the licence files). The second is the encrypted file with user info, licence period etc.

A.现在,您可以为应用程序提供一个安装软件包,该软件包会将您的应用程序安装到相关目录(即C:\ Pogram Files等)中,而无需提供许可证文件,在这种情况下,您可以使用许可证安装程序来部署许可证文件.然后可以使用Environment.SpecialFolder为每个用户分别安装许可证,以确保每个用户都有自己的许可证(当然,这将假定管理员"首先为所有用户安装了该应用程序,并且该许可证安装包将在逐个用户的基础上运行).注意:在这种情况下,我目前不熟悉WP7应用程序和具体细节.

A. You could now provide an install package for your application that will install your application in the relevant directory (i.e. C:\Pogram Files etc.) without providing the licence files, in which case you can deploy the licence files with a licence installer. The licence could then separately be installed for each user employing `Environment.SpecialFolder's to ensure each user has their own licence (of course this would assume that the 'Administrator' installed the application in the first instance for all users and that the licence install pack would be run on a user-by-user basis). Note: I am currently not familiar with WP7 applications and the specifics in this case.

B.第二种方法是允许个人用户安装应用程序,并在安装应用程序时安装相关的许可证文件.

B. The second way would be to allow individual users to install the application, and to install the relevant licence files upon the applications installation.

经过广泛的研究,我已经使用此方法部署了多个WinForm应用程序,并且似乎运行良好.我希望这会有所帮助.

I have deployed several WinForm applications using this methodology after an extensive research period and it seems to work well. I hope this is of some help.

这篇关于授权WPF,Silverlight和WP7程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆