Example #1
0
    protected void Button2_Click(object sender, EventArgs e)
    {
        CerFileOP objCer = new CerFileOP();

        byte[]                   btCer = objCer.ReadFile(@"D:\我的工作\号百\号百三期\MBOSS单点登录\ua联调\cert\jfsc.p12");
        X509Certificate2         x509  = new X509Certificate2(btCer, "12345678");
        DSACryptoServiceProvider dsa   = (DSACryptoServiceProvider)x509.PrivateKey;

        //byte[] OriginalByte = System.Text.Encoding.UTF8.GetBytes(btCer);

        byte[] s = dsa.SignData(btCer);
    }
Example #2
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        string    SPID     = txtSPID.Text.Trim();
        string    FilePath = txtFilePath.Text.Trim();
        string    UserName = txtUserName.Text.Trim();
        string    Password = txtPassword.Text.Trim();
        string    ErrMsg   = "";
        CerFileOP cfObj    = new CerFileOP();

        byte[] btCer = cfObj.ReadFile(FilePath);

        int Result = cfObj.InsertCerFileByte(SPID, ddlCerType.SelectedValue, FilePath, UserName, Password, btCer, out ErrMsg);

        Response.Write(Result.ToString() + "," + ErrMsg);
    }