Пример #1
0
    protected void Page_PreRender(object sender, EventArgs e)
    {
        HROne.Common.WebUtility.WebControlsLocalization(this, this.Controls);


        if (!Page.IsPostBack)
        {
            HROne.CommonLib.RSACrypto rsa = new HROne.CommonLib.RSACrypto("HROneSaaS");
            //txtPublicKeyXMLString.Text = rsa.ToXmlString();
        }
    }
Пример #2
0
    protected void Save_Click(object sender, EventArgs e)
    {
        HROne.CommonLib.RSACrypto rsa = null;
        if (cbxEncryptedDataBy.SelectedValue.Equals("buildin", StringComparison.CurrentCultureIgnoreCase))
        {
            rsa = new HROne.CommonLib.RSACrypto("HROneSaaS");
        }
        //else
        //{
        //    rsa = new HROne.CommonLib.RSACrypto();
        //    rsa.FromXMLString(txtPublicKeyXMLString.Text);
        //}
        string          encryptedString = rsa.Encrypting(txtPasspharse.Text);
        HROneSaaSConfig SaaSconfig      = HROneSaaSConfig.GetCurrentConfig();
        HROneConfig     config          = new HROneConfig(SaaSconfig.HROneConfigFullPath);

        config.databaseEncryptKey = encryptedString;
        config.Save();
    }