summaryrefslogtreecommitdiffstats
path: root/dogtag/common-ui/shared/admin/console/config/certrequestpanel.vm
blob: 0502834e4c23aed75293194d8fbfb8f8124b2eba (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
<!-- --- BEGIN COPYRIGHT BLOCK ---
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     the Free Software Foundation; version 2 of the License.

     This program 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 General Public License for more details.

     You should have received a copy of the GNU General Public License along
     with this program; 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">

.floating {
  position: absolute;
  left: 250px;
  top: 50px;
  width: 600px;
  padding: 3px;
  border: solid;
  border-width: 5px;
  background: white;
  display: none;
  margin: 5px;
}
</style>
<SCRIPT type="text/JavaScript">
function myOnLoad() {
}

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

function showcert(element, event)
{
  var x = event.clientX;
  var y = event.clientY;

  var content = element.getAttribute("content");
  var content_d = element.getAttribute("content_desc");

  if (content == null) { return false; }

  var n = element.getAttribute("n");

  var editableType = element.getAttribute("editableType");
  var desc;
  var d;
  var c;
  if (editableType == "cert")
  {
    d = document.getElementById(n+"_editCertDiv");
    c = document.getElementById(n+"_text");
    desc = document.getElementById(n+"_desc_t");
  } else if (editableType == "certchain") {
    d = document.getElementById(n+"_editCertChainDiv");
    c = document.getElementById(n+"_cc_text");
    desc = document.getElementById(n+"_cc_desc_t");
  } else {
    d = document.getElementById(n+"_showCertDiv");
    c = document.getElementById(n+"_pre");
    desc = document.getElementById(n+"_desc_p");
  }

  if (desc.hasChildNodes())
  {
    desc.removeChild(desc.childNodes[0]);
  }
  var content_desc = document.createTextNode(content_d);
  desc.appendChild(content_desc);
    
  if (c.hasChildNodes())
  {
    c.removeChild(c.childNodes[0]);
  }
  var content_text = document.createTextNode(content);
  c.appendChild(content_text);
    
  d.style.left = x+30; // x-offset of floating div
  assumedheight = 1000;

  var offset = 20;     // extra y-offset of floating div
  var bottom =  y + offset + assumedheight;
  if (bottom > window.innerHeight) {
     offset = 0 - (2*offset) - assumedheight;
  }

  d.style.top = y+ offset +document.body.scrollTop;

  // unhide the window
  d.style.display ="block";

}

function hide(tag)
{
    document.getElementById(tag+"_showCertDiv").style.display ="none";
    document.getElementById(tag+"_editCertDiv").style.display ="none";
    document.getElementById(tag+"_editCertChainDiv").style.display ="none";
}

</SCRIPT>
A certificate signing request (CSR) contains a public key and is an unsigned copy of the certificate.
<p>
If a given CSR has been successfully signed by a CA, then the certificate will be designated below by a certificate icon labeled Certificate Generated Successfully.
<p>
However, if a given CSR contains an <font color="red">action required</font> label under its certificate icon, then those requests must be <i>manually</i> submitted to a CA for certificate generation.
<p>
Press the [Apply] button after certificates and chains are pasted in.
<p>
Press the [Next] button once all certificates have been generated successfully.
<p>
#foreach ($item in $reqscerts)
<H2>$item.getDN()</H2>
<table width=100%>
<tr>
  <td width=10%></td>
  <td width=20%></td>
  <td width=70%></td>
</tr>

<tr>
  <td>&nbsp;</td>
#if ($item.getCert() == "...paste certificate here...") 
  <td><font color=red>action required</font><br>
<img alt="" src="/pki/images/no-certificate.png"/></td>
#elseif ($item.getCert() == "...certificate be generated internally...")
<td>
  <img alt="" src="/pki/images/no-certificate.png"/><br>
  certificate will be generated internally
  </td>
#elseif ($item.getCert() == "")
  <td>
<img alt="" src="/pki/images/no-certificate.png"/><br>
  No Certificate Generated. Please import.<br>
  </td>
#else
  <td>
<img alt="" src="/pki/images/certificate.png"/><br>
  Certificate Generated Successfully
  </td>
#end

<td>


#if ($item.getCert() == "...paste certificate here...") 
<a content="$item.getRequest()" content_desc="Copy the following Certificate Request (CSR) and paste it in the external CA enrollment page for enrollment" n="$item.getCertTag()" href="#" onclick="showcert(this,event);"> Step 1: Copy the Certificate Request (CSR) to enroll at an external CA</a><p>
<a content="" content_desc="Copy the base64-encoded PKCS #7 certificate chain into the text box below and press 'X'" n="$item.getCertTag()" editableType="certchain" href="#" onclick="showcert(this,event);"> Step 2: Import the PKCS #7 Certificate Chain (optional if the certificate already contains the chain)</a><p>
<a content="$item.getCert()" content_desc="Copy the resulting base64-encoded certificate (NOTE: PKCS #7 not accepted) into the text box below and press 'X'" n="$item.getCertTag()" editableType="cert" href="#" onclick="showcert(this,event);"> Step 3: Paste in the Base64-encoded Certificate after enrollment at an external CA (NOTE: this text box does not accept PKCS #7 certificate chains)</a><p>
#elseif ($item.getCert() == "...certificate be generated internally...")
<p>
#else
<a content="$item.getRequest()" content_desc="Certificate Request (CSR)" n="$item.getCertTag()" href="#" onclick="showcert(this,event);"> View Certificate Request (CSR)</a><p>
<a content="$item.getCert()" content_desc="Certificate in Base64 encoding" n="$item.getCertTag()" href="#" onclick="showcert(this,event);"> View Certificate in Base64-Encoding</a><p>
<a content="$item.getEscapedCertpp()" content_desc="Certificate in pretty print" n="$item.getCertTag()" href="#" onclick="showcert(this,event);"> View Certificate Pretty Print</a><p>
#end


</td>
</tr>
</table>
                                                                                
<div id="$item.getCertTag()_showCertDiv" class="floating">
<div align="right" onclick="hide('$item.getCertTag()');">X</div>
<table id="$item.getCertTag()_stable" width="100%">
<tr>
<td id="$item.getCertTag()_desc_p"></td>
</tr>
<tr>
<td><pre name="$item.getCertTag()" id="$item.getCertTag()_pre">$item.getCert()</pre></td>
</tr>
</table>
</div>

<div id="$item.getCertTag()_editCertDiv" class="floating">
<div align="right" onclick="hide('$item.getCertTag()');">X</div>
<table id="$item.getCertTag()_etable" width="100%">
<tr>
<td id="$item.getCertTag()_desc_t"></td>
</tr>
<tr>
<td><textarea rows=30 cols=90 name="$item.getCertTag()" id="$item.getCertTag()_text" style="font-family: monospace;">$item.getCert()</textarea></td>
</tr>
</table>
</div>

<div id="$item.getCertTag()_editCertChainDiv" class="floating">
<div align="right" onclick="hide('$item.getCertTag()');">X</div>
<table id="$item.getCertTag()_cc_etable" width="100%">
<tr>
<td id="$item.getCertTag()_cc_desc_t"></td>
</tr>
<tr>
<td><textarea rows=30 cols=90 name="$item.getCertTag()_cc" id="$item.getCertTag()_cc_text" style="font-family: monospace;"></textarea></td>
</tr>
</table>
</div>


#end

    <p>


    <div align="right">
      <hr />
      &nbsp;
    </div>