summaryrefslogtreecommitdiffstats
path: root/dogtag/tps-ui/shared/docroot/tps/admin/console/config/sizepanel.vm
blob: 72c095491980136e33844236b4606e17cd5a1480 (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
<!-- --- BEGIN COPYRIGHT BLOCK ---
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     License as published by the Free Software Foundation.
     
     This library is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     Lesser General Public License for more details.
     
     You should have received a copy of the GNU Lesser General Public
     License along with this library; if not, write to the Free Software
     Foundation, Inc., 51 Franklin Street, Fifth Floor,
     Boston, MA  02110-1301  USA 
     
     Copyright (C) 2007 Red Hat, Inc.
     All rights reserved.
     --- END COPYRIGHT BLOCK --- -->
<style type="text/css">
div#advance
{
  margin: 0px 20px 0px 20px;
  display: none;
}
div#simple
{
  margin: 0px 20px 0px 20px;
  display: block;
}
</style>

<SCRIPT type="text/JavaScript">
var keys_ecc_curve_list="$keys_ecc_curve_list";
var keys_ecc_curve_display_list = "$keys_ecc_curve_display_list";
var keys_rsa_size_display_list = "$keys_rsa_size_display_list";

function myOnLoad() {
}

function performPanel() {
    with (document.forms[0]) {
        submit();
    }
}

function toggleLayer(whichLayer)
{
  if (document.getElementById) {
    // this is the way the standards work
    var style2 = document.getElementById(whichLayer).style;
    if (style2.display == "block") {
      style2.display = "none";
    } else {
      style2.display = "block";
    }
  }
}

function toggleLayer1(whichLayer)
{
  if (document.getElementById) {
    // this is the way the standards work
    var style2 = document.getElementById(whichLayer).style;
    if (style2.display == "block") {
      style2.display = "none";
    } else if (style2.display == "") {
      style2.display = "none";
    } else {
      style2.display = "block";
    }
  }
}

function keyTypeChange()
{
  var form = document.forms[0];

  var keyTypeSelect = document.forms[0].elements['keytype'];
  for (var i = 0; i < form.length; i++) {
    var name = form[i].name;
    if (name.indexOf('_keytype') != -1) {
      if (keyTypeSelect.value.indexOf('ecc') != -1) {
        form.elements[name].selectedIndex = keyTypeSelect.selectedIndex;
      }
    }
  }
}

function defaultChange()
{
  var form = document.forms[0];
  var choiceSelect = document.forms[0].elements['choice'];
  for (var i = 0; i < form.length; i++) {
    var name = form[i].name;
    if (name.indexOf('_choice') != -1) {
      for (var j = 0; j < form.elements[name].length; j++) {
        var c = form.elements[name];
        c[j].checked = choiceSelect[j].checked;
      }
    }
  }
}

function customChange()
{
  var form = document.forms[0];
  var choiceSelect = document.forms[0].elements['choice'];
  for (var i = 0; i < form.length; i++) {
    var name = form[i].name;
    if (name.indexOf('_choice') != -1) {
      for (var j = 0; j < form.elements[name].length; j++) {
        var c = form.elements[name];
        c[j].checked = choiceSelect[j].checked;
      }
    }
  }
}

function textChange()
{
  var customSize = document.forms[0].elements['custom_size'];
  var form = document.forms[0];
  for (var i = 0; i < form.length; i++) {
    var name = form[i].name;
    if (name.indexOf('_custom_size') != -1) {
      form.elements[name].value = customSize.value;
    }
  }
}

function displayCurveList()
{
  var list = keys_ecc_curve_display_list.split(",");
  var linelen = 0;
  for (var i=0; i < list.length -1 ; i++) {
    document.write(list[i] + ",");
    linelen = linelen + list[i].length;
    if (linelen >= 60) {
      document.write("<br/>");
      linelen=0;
    }
  }
  document.write(list[list.length -1]);
}

function displayStrengthList()
{
  var list = keys_rsa_size_display_list.split(",");
  var linelen = 0;
  for (var i=0; i < list.length -1 ; i++) {
    document.write(list[i] + ",");
    linelen = linelen + list[i].length;
    if (linelen >= 60) {
      document.write("<br/>");
      linelen=0;
    }
  }
  document.write(list[list.length -1]);
}

</SCRIPT>
Select the key pair type(s) and associated key pair size(s) from the pulldown menus. <a href="javascript:toggle_details();">[Details]</a>
<p>
Note that only RSA is supported for the audit_signing certificate at this point
<p>
<SCRIPT type="text/JavaScript">
function toggle_details()
{
  d = document.getElementById('details');
  if (d.style.display == "block") {
    d.style.display="none";
  } else {
    d.style.display="block";
  }
}
</SCRIPT>
<div id=details style="display: none;">
<p> 
Each certificate can have its own key pair generated with its own independent settings or common settings can be applied to all key pairs. At minimum, each key pair has to define what <i>type</i> it is by identifying a cipher family and then has to set a <i>strength</i> for that key.
</p>
<ul>
<li>
<b><i>Key Type</i></b>. Sets the cipher family to use to generate the key pair. RSA and ECC key types have slightly different strength options.
</li>
<li>
<b><i>RSA strength: Key Size</i></b>. Sets the key length for the generated pair. The key length can be one of the lenghs listed below.  Longer keys are stronger, which makes them more secure.
However, longer key pair sizes also increase the time required to perform operations such as signing certificates, so long keys can affect performance.
<br/><ul style="list-style:none"><li><i>
<SCRIPT type="text/JavaScript">
displayStrengthList();
</SCRIPT></i></li></ul>
</li>
<li>
<b><i>ECC strength: Curve Name</i></b>. Sets the curve algorithm to use, which can be any one of the curves listed below.  The curves that are included in parenthesis are equivalent - and either name can be used.  Note that not all curves may be supported by the token.
<br/><ul style="list-style:none"><li><i>
<SCRIPT type="text/JavaScript">
displayCurveList();
</SCRIPT></i></li></ul>
</li>
</ul>
<br/>
</div>
#if ($errorString != "")
<img src="../img/icon_crit_update.gif">&nbsp;<font color="red">$errorString</font>
#end
<p>
<div id="simple">
<p>
<table width=100%>
<tr>
  <td align=right><a href="javascript:toggleLayer1('simple'); toggleLayer('advance');" title="Advanced">[Advanced]</a></td>
</tr>
</table>
<p>
<H2>Common Key Settings</H2>
<p>
<table width=100% class="details">
      <tr>
        <th width="30%">Key Type:</th>
        <td><select name="keytype" onChange="keyTypeChange()"><option value=rsa>RSA</option><option value=ecc>ECC</option></select></td>
      </tr>
</table>
<p>

<p>
    <input
#if ($select == "default")
 checked
#end
 onChange="defaultChange()" type=radio name="choice" value="default"><b>Use the default key size ($default_keysize  bits for RSA; curve $default_ecc_curvename  for ECC)</b>.
    <p>
    <input
#if ($select == "custom")
 checked
#end
 onChange="customChange()" type=radio name="choice" value="custom"><b>Use the following custom key strength:</b>
                                                                                
    <p>
<table width=100% class="details">
      <tr>
        <th>Key Size or Curve (see Details above):</th>
        <td><input onChange="textChange()" type="text" size="20" name="custom_size" value="" /></td>
      </tr>
</table>
<p>
</div>

<div id="advance">
<p>
<table width=100%>
<tr>
  <td align=right><a href="javascript:toggleLayer1('simple');toggleLayer('advance');" title="Simple">[Simple]</a></td>
</tr>
</table>

#foreach ($item in $certs)
<H2>Key for $item.getUserFriendlyName()</H2>
<p>
<table width=100% class="details">
      <tr>
        <th width="30%">Key Type:</th>
#if ($item.getCertTag() == "audit_signing")
        <td><select name="$item.getCertTag()_keytype"><option value=rsa>RSA</option></select></td>
#else
        <td><select name="$item.getCertTag()_keytype"><option value=rsa>RSA</option><option value=ecc>ECC</option></select></td>
#end
      </tr>
</table>
<p>
    <input
#if ($item.useDefaultKey())
 checked
#end
 type=radio name=$item.getCertTag()_choice value="default"><b>Use the default key size ($default_keysize bits for RSA, curve $default_ecc_curvename for ECC).
    <p>
    <input
#if (!$item.useDefaultKey())
 checked
#end
 type=radio name=$item.getCertTag()_choice value="custom"><b>Use the following custom key strength:</b>
                                                                                
    <p>
<table width=100% class="details">
      <tr>
        <th>Key Size or Curve (see Details above):</th>
        <td><input type="text" size="20" name=$item.getCertTag()_custom_size value="" /></td>
      </tr>
</table>
#end
</div>

<br/>
<br/>
<br/>
#if ($firsttime == 'false')
<input type="CHECKBOX" NAME="generateKeyPair">New Keys<p>
#end
<p>
    <div align="right">
      <hr />
<i>Note: After pressing Next, keys will be generated on the server, which will take some time to complete.  Please wait for the next panel to appear.</i>
      &nbsp;
    </div>