-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathR_findsk.jsp
61 lines (56 loc) · 1.98 KB
/
R_findsk.jsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<title>Authentication Page</title>
<%@ page import="java.util.Date" %>
<%@page import ="java.util.*"%>
<%@page import ="java.sql.*"%>
<%@page import ="java.util.*,java.security.Key,java.util.Random,javax.crypto.Cipher,javax.crypto.spec.SecretKeySpec,org.bouncycastle.util.encoders.Base64"%>
<%@ page import="java.sql.*,java.util.Random,java.io.PrintStream,java.io.FileOutputStream,java.io.FileInputStream,java.security.DigestInputStream,java.math.BigInteger,java.security.MessageDigest,java.io.BufferedInputStream" %>
<%@ page import ="java.security.Key,java.security.KeyPair,java.security.KeyPairGenerator,javax.crypto.Cipher"%>
<%@page import ="java.util.*,java.text.SimpleDateFormat,java.util.Date,java.io.FileInputStream,java.io.FileOutputStream,java.io.PrintStream"%>
<%@ include file="connect.jsp" %>
<%
String fname=request.getParameter("t14");
String uname=(String)application.getAttribute("rname");
String key="";
try{
String sql1="SELECT * FROM cloudserver where fname='"+fname+"'";
Statement stmt1 = connection.createStatement();
ResultSet rs1 =stmt1.executeQuery(sql1);
if(rs1.next())
{
String sql="SELECT * FROM request where user='"+uname+"' and fname='"+fname+"'";
Statement stmt = connection.createStatement();
ResultSet rs =stmt.executeQuery(sql);
if(rs.next())
{
key=rs.getString(5);
if (key.equalsIgnoreCase("Generate Key"))
{
key=" Secret Key Not Generated !!";
application.setAttribute("key",key);
response.sendRedirect("R_MSKRes.jsp");
}
else
{
application.setAttribute("key",key);
response.sendRedirect("R_MSKRes.jsp");
}
}
else
{
key="Secret Key Not Requested !!";
application.setAttribute("key",key);
response.sendRedirect("R_MSKRes.jsp");
}
}
else
{
key="File Not Found !!";
application.setAttribute("key",key);
response.sendRedirect("R_MSKRes.jsp");
}
}
catch(Exception e)
{
out.print(e);
}
%>