summaryrefslogtreecommitdiffstats
path: root/dogtag/kra-ui/shared/webapps/kra/agent/kra/SrchRecoverKey.html
blob: ccffb0775e719677b2932dd430f410bb1d60f401 (plain)
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
   <meta name="GENERATOR" content="Mozilla/4.5 [en]C-NSCP  (WinNT; I) [Netscape]">
   <title>Recover Keys (for Administrators)</title>
</head>

<SCRIPT LANGUAGE="JavaScript"></SCRIPT>
<script language="JavaScript" src="../funcs.js"></script>
<script language="JavaScript" src="../helpfun.js"></script>
<script language="JavaScript">
//<!--
function publicKeyCritInUse()
{
    return document.publicKeyCritForm.inUse.checked;
}
function publicKeyCrit()
{
    if (document.publicKeyCritForm.publicKeyData.value.length == 0) {
        alert("No public key specified");
        return null;
    }
    return "publicKey=x509cert#"+
        escapeValue(document.publicKeyCritForm.publicKeyData.value);
}
function ownerNameCritInUse()
{
    return document.ownerNameCritForm.inUse.checked;
}
function ownerNameCrit()
{
    return "keyOwnerName=" + document.ownerNameCritForm.ownerName.value;
}
function serialNumberRangeCritInUse()
{
	return document.serialNumberRangeCritForm.inUse.checked;
}

function serialNumberRangeCrit()
{
    var crit = new Array;
    var next = 0;

    var canonicalFrom = "", canonicalTo = "";

    if (document.serialNumberRangeCritForm.serialFrom.value != "") {
        if (isHex(document.serialNumberRangeCritForm.serialFrom.value)) {
          canonicalFrom = parseInt(stripPrefix(document.serialNumberRangeCritForm.serialFrom.value),16);
        } else {
          canonicalFrom = document.serialNumberRangeCritForm.serialFrom.value;
        }
        crit[next++] = "keySerialNumber >= " + canonicalFrom;
    }
    if (document.serialNumberRangeCritForm.serialTo.value != "") {
        if (isHex(document.serialNumberRangeCritForm.serialTo.value)) {
          canonicalTo = parseInt(stripPrefix(document.serialNumberRangeCritForm.serialTo.value),16);
        } else {
          canonicalTo = document.serialNumberRangeCritForm.serialTo.value;
        }
        crit[next++] = "keySerialNumber <= " +canonicalTo;
    }

    if (document.serialNumberRangeCritForm.serialFrom.value != "" &&
	document.serialNumberRangeCritForm.serialTo.value != "") {
	if (parseInt(canonicalFrom) > parseInt(canonicalTo)) {
	    	alert("The low end of the range is larger than the high end.");
		return null;
	}
    }

	if (next == 0) {
		return "keySerialNumber=*";
	} else if (next == 1) {
		return crit[0];
	} else if (next == 2) {
		return "&(" + crit[0] + ")(" + crit[1] + ")";
	} 
    // return crit.join("&");
}
function archivedByCritInUse()
{
    return document.archivedByCritForm.inUse.checked;
}

function archivedByCrit()
{
    if (document.archivedByCritForm.archivedBy.value.length == 0) {
        alert("User id in 'issued by' filter is empty");
        return null;
    }
    return "keyArchivedBy = "+ 
		document.archivedByCritForm.archivedBy.value;
}

function doSubmit(form)
{
    var andFilter = new Array;
    var critCount = 0;

    if (serialNumberRangeCritInUse()) {
	if ((andFilter[critCount++] = serialNumberRangeCrit()) == null)
	    return;
    }	
    if (ownerNameCritInUse()) {
    	if ((andFilter[critCount++] = ownerNameCrit()) == null)
	   return;
    }
    if (publicKeyCritInUse()) {
    	if ((andFilter[critCount++] = publicKeyCrit()) == null)
	   return;
	form.publicKeyData.value = document.publicKeyCritForm.publicKeyData.value;
    }
    if (archivedByCritInUse()) {
    	if ((andFilter[critCount++] = archivedByCrit()) == null)
	   return;
    }

    // At least one section must be selected
    if (critCount == 0) {
	alert("You must choose at least one section on this form.");
	return;
    } else if (critCount == 1) {
    		form.queryFilter.value = "(" + andFilter[0] + ")";
	} else if (critCount == 2) {
    		form.queryFilter.value = "(&(" + andFilter[0] + ")(" + 
			andFilter[1] + "))";
	} else if (critCount == 3) {
    		form.queryFilter.value = "(&(" + andFilter[0] + ")(" + 
			andFilter[1] + ")(" + andFilter[2] + "))";
	} else if (critCount == 4) {
    		form.queryFilter.value = "(&(" + andFilter[0] + ")(" + 
			andFilter[1] + ")(" + andFilter[2] + ")(" +
			andFilter[3] + "))";
	}

    // form.queryFilter.value = andFilter.join("&");

    form.op.value = "srchKeyForRecovery";

    keyQuery = "srchKeyForRecovery?op=" + form.op.value + 
                "&maxResults=" + form.maxResults.value +
                "&maxCount=" + form.maxCount.value +
                "&queryFilter=" + 
			       produceHTTPEscapedString(form.queryFilter.value);
   if (form.publicKeyData.value != "") {
       keyQuery = keyQuery + "&publicKeyData="+
               produceHTTPEscapedString(form.publicKeyData.value);
   }

    // Create two frames
    window.location=keyQuery;
}
//-->
</script>
<body bgcolor="#FFFFFF">
<font size=+1 face="PrimaSans BT, Verdana, sans-serif">
Recover Keys (for Administrators)</font>
<br><font size=-1 face="PrimaSans BT, Verdana, sans-serif">Use this form
to search for archived keys according to the criteria you specify. 
<table BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%" BACKGROUND="/pki/images/hr.gif" >
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
Each section
lets you specify a key property. Select a property, then fill in any needed details in that section. You can combine search criteria to further narrow the search.
<p>
In the list of keys found by the search, you can click a button to recover individual keys.
</font>

<table BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%" BACKGROUND="/pki/images/hr.gif" >
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
<b><font size=-1 face="PrimaSans BT, Verdana, sans-serif">Owner Name</font></b>
<form name="ownerNameCritForm">
<input type="CHECKBOX" name="inUse">
<font size=-1 face="PrimaSans BT, Verdana, sans-serif">Show
keys belonging to a particular owner</font>
<blockquote>
<table>
<tr>
<td>
<font size=-1 face="PrimaSans BT, Verdana, sans-serif">Owner Name:</font>
</td>
<td>
<input type="TEXT" name="ownerName" size=36>
</td>
</tr>
</table>
</blockquote>
</form>

<table BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%" BACKGROUND="/pki/images/hr.gif" >
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
<b><font size=-1 face="PrimaSans BT, Verdana, sans-serif">Key Identifiers</font></b>
<form name="serialNumberRangeCritForm">
<input type="CHECKBOX" name="inUse"><font face="PrimaSans BT, Verdana, sans-serif"><font size=-1>Show
keys that fall within a particular range of key identifiers</font></font>
<blockquote>
<font face="PrimaSans BT, Verdana, sans-serif"><font size=-1>Enter
a range of key identifiers in hexadecimal form (starting with 0x, as they appear in key displays) or in decimal form.</font></font>
<p>
<table>
<tr>
<td>
<font size=-1 face="PrimaSans BT, Verdana, sans-serif">Lowest
key identifier:</font>
</td>
<td>
<input TYPE="TEXT" NAME="serialFrom" SIZE=10 MAXLENGTH=99">
</td>
<td>
<font size=-1 face="PrimaSans BT, Verdana, sans-serif">
(leave blank for no lower limit)
</font>
</td>
</tr>
<tr>
<td>
<font size=-1 face="PrimaSans BT, Verdana, sans-serif">Highest
key identifier:</font>
</td>
<td>
<input TYPE="TEXT" NAME="serialTo" SIZE=10 MAXLENGTH=99">
</td>
<td>
<font size=-1 face="PrimaSans BT, Verdana, sans-serif">
(leave blank for no upper limit)
</font>
</td>
</tr>
</table>
</blockquote>
</form>

<table BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%" BACKGROUND="/pki/images/hr.gif" >
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
<b><font size=-1 face="PrimaSans BT, Verdana, sans-serif">Certificate</font></b>
<form name="publicKeyCritForm">
<input type="CHECKBOX" name="inUse"><font size=-1 face="PrimaSans BT, Verdana, sans-serif">Show
the key that corresponds to the following certificate</font>
<blockquote>
<font size=-1 face="PrimaSans BT, Verdana, sans-serif">
Copy the certificate, then paste it into this text area.</font>
<p>
<textarea name="publicKeyData" rows=10 cols=64></textarea></form>
</blockquote>

<table BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%" BACKGROUND="/pki/images/hr.gif" >
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
<b><font size=-1 face="PrimaSans BT, Verdana, sans-serif">Archiver</font></b>
<form name="archivedByCritForm">
<input type="CHECKBOX" name="inUse"><font size=-1 face="PrimaSans BT, Verdana, sans-serif">Show
keys that have been archived by</font> a particular server
<blockquote>
<font size=-1 face="PrimaSans BT, Verdana, sans-serif">
Enter the user ID of the Certificate or Registration Manager that submitted the archival request to the Data Recovery Manager.
</font>
<p>
<font size=-1 face="PrimaSans BT, Verdana, sans-serif">
User ID:
</font>
<input TYPE="text" NAME="archivedBy" SIZE=10>
<p>
<font size=-1 face="PrimaSans BT, Verdana, sans-serif">
Note: Archiver information is available only when the Certificate Manager or Registration Manager is remote from the Data Recovery Manager.
</font>
<p>
</blockquote>
</form>

<br><form name="queryForm" action="srchKeyForRecovery" method=POST>
<input type="HIDDEN" name="op" value="">
<input type="HIDDEN" name="maxCount" VALUE="5">
<input type="HIDDEN" name="queryFilter" VALUE="">
<input type="HIDDEN" name="publicKeyData" VALUE="">
<table BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%" BACKGROUND="/pki/images/hr.gif" >
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>

<font size=-1 face="PrimaSans BT, Verdana, sans-serif"><b>Limits</b></font>
<table border="0" cellspacing="2" cellpadding="2">
  <tr>
    <td align="right">
      <font size=-1 face="PrimaSans BT, Verdana, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;
      Maximum results:</font>
    </td>
    <td>
      <INPUT TYPE="TEXT" NAME="maxResults" VALUE=10 SIZE=5 MAXLENGTH=10>
    </td>
  </tr>
  <tr>
    <td align="right">
      <font size=-1 face="PrimaSans BT, Verdana, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;
      Time limit (in seconds):</font>
    </td>
    <td>
      <INPUT TYPE="TEXT" NAME="timeLimit" SIZE=5 MAXLENGTH=10>
    </td>
  </tr>
</table>
<br>
<TABLE cellpadding="6" cellspacing="0" border="0" width="100%">
<TR>
<TD align="right" bgcolor="#eeeeee">
<input type="button" value="Show Key" onClick='doSubmit(queryForm)'>
<!-- <input type="button" value=Help
onClick="help('/manual/agt_gide/kraagt.htm#1019227')"> -->
</TD>
</TR>
</TABLE>
</form>
</body>
</html>