JSP code
<%@ page language= "java" pageencoding= "UTF-8"%>
<% @page import= "QQ. Qqcontactsservice "%>
<% @page import= "QQ. Rsainfo "%>
<%
Qqcontactsservice service = Qqcontactsservice.getinstance ();
Rsainfo RSA = Service.getrsainfo ();
Request.setattribute ("Domain", rsa.getdomain ());
Request.setattribute ("PublicKey", Rsa.getpublickey ());
Request.setattribute ("TS", Rsa.getts ());
%>
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >
<TITLE>QQ Import contact</title>
<script language= "JavaScript" src= "Js/auth.js" ></script>
<body>
<form name= "Form1" action= "action.jsp" onsubmit= "Ras ()" method= "POST" >
Qq:
<input type= "text" name= "UIn" id= "UIn" >
<br>
Pwd:
<input type= "password" name= "pp" id= "pp" >
<br>
Verify
<input type= "text" name= "Verifycode" id= "Verifycode" >
<br>
<input type= "hidden" name= "domain" id= "domain" value= "${domain}" >
<input type= "hidden" name= "ts" id= "ts" >
<input type= "hidden" name= "StartTime" id= "StartTime" >
<input type= "hidden" name= "P" id= "P" >
<input type= "Submit" Name= "Login" >
<br>
</form>
<script type= "Text/javascript" >
var S = function (object) {
return document.getElementById (object);
};
Function Ras () {
var publickey = "${publickey}";
var RSA = new Rsakey ();
Rsa.setpublic (PublicKey, "10001");
var publicts= "${ts}";
var Res = Rsa.encrypt (S ("pp"). Value + ' \ n ' + publicts + ' \ n ');
if (Res) {
Document.form1.p.value = hex2b64 (Res);
}
var maskvalue = "";
for (var Loop = 0; Loop < S ("pp"). Value.length; loop++, Maskvalue + + "0");
Document.form1.pp.value = Maskvalue;
Document.form1.starttime.value = (new Date ()). valueof ();
}
</script>
</body>