Beispiel #1
0
        public LicenseInfo GetLicense()
        {
            string privateKey = ReadFile(privateKeyPath);

            LicenseInfo licenseInfo = new LicenseInfo();

            string encryptString = ReadFile(licensePath);
            string licenseString = RSADecrypt(privateKey, encryptString);
            licenseInfo.GetInfo(licenseString);
            return licenseInfo;
        }
Beispiel #2
0
        public void GenerateLicense(int usedDays)
        {
            string publicKey = ReadFile(publicKeyPath);

            LicenseInfo licenseInfo = new LicenseInfo();
            licenseInfo.usedDays = usedDays;
            string encryptString = RSAEncrypt(publicKey, licenseInfo.GenerateLicenseString());
            CreateFile(licensePath, encryptString);
        }