salasadi
asked on
while retrun bad result!
The following code work file when the vector retrun 1 account, however, when vector retrun more then 1 record, some how the encryption did not work correctly.
I am getting the data from database then store in vector, then in my JSP retrieve the result. while retrive the result, I add the result to XML string then encrypted and display it in form so use can click on "Go" button to summit to the remote server.
someone everything working when just one account retrun, but mess up when more then one account. I put select statement in the loop to see I am getting the correct data and yes I am getting the correct record, but the encryption did not work correctly.
Thanks in advanace
Vector v = new HBECust().getNumber(test);
Iterator i = v.iterator();
while (i.hasNext()) {
Vector row = (Vector)i.next();
BigDecimal AcctNum1 = (BigDecimal)row.get(0);
String TypeC = (String)row.get(1);
PublicKey ="XXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXX";
PrivateKey ="XXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXX";
cryptodata = "<Request><AccountNumber>" + AcctNum1 +"</AccountNumber><Type>"+ TypeC+"</T ype><Expir eDateTime> "+dateStri ng+"</Expi reDateTime ><EmailAdd ress>email @email.com </EmailAdd ress></Req uest>";
TDESEncryptor encryptz1 = new TDESEncryptor ();
String cryptodata1 = encryptz1.Encrypt(PrivateK ey,cryptod ata);
String test1 ="<Wrapper><ClientId>99999 9</ClientI d><Request >" + cryptodata1 +"</Request></Wrapper>";
cryptoPublic = encryptz1.Encrypt(PublicKe y,test1);
%>
<tr bgcolor= ><td>Card Number:</td><td align=left><%= AcctNum1%></td><td>Type: <%= TypeC %></td><td>
<input type="hidden" name="test2" value="<%=cryptoPublic%>">
<input type="submit" id=Submit3>
<%
}
%>
I am getting the data from database then store in vector, then in my JSP retrieve the result. while retrive the result, I add the result to XML string then encrypted and display it in form so use can click on "Go" button to summit to the remote server.
someone everything working when just one account retrun, but mess up when more then one account. I put select statement in the loop to see I am getting the correct data and yes I am getting the correct record, but the encryption did not work correctly.
Thanks in advanace
Vector v = new HBECust().getNumber(test);
Iterator i = v.iterator();
while (i.hasNext()) {
Vector row = (Vector)i.next();
BigDecimal AcctNum1 = (BigDecimal)row.get(0);
String TypeC = (String)row.get(1);
PublicKey ="XXXXXXXXXXXXXXXXXXXXXXXX
PrivateKey ="XXXXXXXXXXXXXXXXXXXXXXXX
cryptodata = "<Request><AccountNumber>"
TDESEncryptor encryptz1 = new TDESEncryptor ();
String cryptodata1 = encryptz1.Encrypt(PrivateK
String test1 ="<Wrapper><ClientId>99999
cryptoPublic = encryptz1.Encrypt(PublicKe
%>
<tr bgcolor= ><td>Card Number:</td><td align=left><%= AcctNum1%></td><td>Type: <%= TypeC %></td><td>
<input type="hidden" name="test2" value="<%=cryptoPublic%>">
<input type="submit" id=Submit3>
<%
}
%>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.