【发布时间】:2010-07-20 14:17:29
【问题描述】:
我的公司产品有一个图形用户界面。 我想保护在客户端和服务器之间来回发送的数据。
SSL 是选项之一吗?如果是,请告诉我如何在我的应用程序代码中实现它的步骤。
我需要购买证书还是我可以制作..哪个是最好的选择?
感谢任何帮助。谢谢..
我使用 FormsAuthenticationTicket 登录如下:
Session["userName"] = UserName.Text;
Session["password"] = Password.Text;
Session["domain"] = Domain.Text;
string role = "Administrators";
// Create the authentication ticket
FormsAuthenticationTicket authTicket = new FormsAuthenticationTicket(1, // version
UserName.Text, // user name
DateTime.Now, // creation
DateTime.Now.AddMinutes(60),// Expiration
false, // Persistent
role); // User data
// Now encrypt the ticket.
string encryptedTicket = FormsAuthentication.Encrypt(authTicket);
// Create a cookie and add the encrypted ticket to the
// cookie as data.
HttpCookie authCookie =
new HttpCookie(FormsAuthentication.FormsCookieName,
encryptedTicket);
// Add the cookie to the outgoing cookies collection.
Response.Cookies.Add(authCookie);
// Redirect the user to the originally requested page
Response.Redirect(FormsAuthentication.GetRedirectUrl(UserName.Text, false));
我不确定这有多安全??任何建议。
【问题讨论】:
-
所以我找到了这个链接..用于 SSL 安装。希望能帮助到你。 windowsecurity.com/articles/Protect-Web-Servers-SSL.html 和 security.fnal.gov/pki/webauthors.html
标签: c# asp.net security ssl client-server