private SerialNumberGenerator CreateSerialNumberGenerator() { var rsaPublicKeyIdentity = new RsaKeySetIdentity(null, RSAKeys.PublicKeys.GetKeyString()); RsaAsymetricEncryption rsaAsymmetricEncryption = new RsaAsymetricEncryption(); RSAParameters pubKeyParams = rsaAsymmetricEncryption.ParseRsaPublicKeyOnlyInfo(rsaPublicKeyIdentity); SerialNumberGenerator serialNumberGenerator = new SerialNumberGenerator(pubKeyParams, SerialNumbersSettings.ProtectedApp.SecureMemo); RegistrationDataModel registrationData = new RegistrationDataModel { Company = "Doe", Salt = GeneralConverters.GetRandomHexValue(256), ValidTo = DateTime.Now.AddYears(1), VersionName = LicenseGeneratorStaticData.SecureMemo.Versions.First() }; serialNumberGenerator.LicenseData.RegistrationData = registrationData; return(serialNumberGenerator); }
private void ComputeAndSetSaltValue() { txtSalt.Text = GeneralConverters.GetRandomHexValue(256); }