Пример #1
0
        private Service()
        {
            InitializeComponent();

            RSAParameters pubKey = new RSAParameters();
            pubKey.Exponent = Convert.FromBase64String(LICENSE_PUBLIC_KEY_EXPONENT);
            pubKey.Modulus = Convert.FromBase64String(LICENSE_PUBLIC_KEY_MODULUS);

            _validator = new LicenseValidator(pubKey);

            _licensor =
                new UdpLicensor(
                    Encoding.UTF8.GetBytes("foobar"),
                    0
                );

            _licensor.LicenseViolated += new EventHandler(_licensor_LicenseViolated);
        }
Пример #2
0
 public void Init()
 {
     rsa = new RSACryptoServiceProvider(2048);
     lv = new LicenseValidator(rsa.ExportParameters(false));
 }