Revert "Revert "and added files""
[bcm963xx.git] / userapps / broadcom / cfm / html / certimport.html
1 <html>
2   <head>
3     <meta HTTP-EQUIV='Pragma' CONTENT='no-cache'>
4     <link rel="stylesheet" href='stylemain.css' type='text/css'>
5       <link rel="stylesheet" href='colors.css' type='text/css'>
6         <script language="javascript" src="util.js"></script>
7         <script language="javascript">
8 <!-- hide
9
10 var keystart = '-----BEGIN RSA PRIVATE KEY-----';
11 var keyinsert = '\n<insert private key here>\n';
12 var keyend = '-----END RSA PRIVATE KEY-----';
13 var certstart = '-----BEGIN CERTIFICATE-----';
14 var certinsert = '\n<insert certificate here>\n';
15 var certend = '-----END CERTIFICATE-----';
16
17 function frmLoad() {
18   document.importForm.action = 'certlocal.cmd?action=import';
19   with ( document.forms[0] ) {
20     certPrivate.value = keystart + keyinsert + keyend + '\n';
21     certPublic.value = certstart + certinsert + certend + '\n';
22   }
23 }
24
25 function applyClick() {
26   var idx;
27  
28   with ( document.forms[0] ) {
29     if ( certName.value == '' ) {
30       alert('Certificate Name should not be empty.');
31       return;
32     }
33     if ( certPrivate.value == '' ) {
34       alert('Certificate Private Key should not be empty.');
35       return;
36     }
37     if ( certPublic.value == '' ) {
38       alert('Certificate Public Key should not be empty.');
39       return;
40     }
41   }
42   document.importForm.submit();
43 }
44 // done hiding -->
45 </script>
46   </head>
47   <body onLoad='frmLoad()'>
48     <blockquote>
49       <form name="importForm" method="post">
50         <b>Import certificate<br>
51         </b>
52         <br>
53         Enter certificate name, paste certificate content and private key.<br>
54         <br>
55         <table border="0" cellpadding="0" cellspacing="0">
56           <tr>
57             <td width="180">Certificate Name:</td>
58             <td><input type='text' name='certName' size='20' maxlength="63"></td>
59           </tr>
60             <tr>
61               <td width="180">Certificate:</td>
62               <td>
63                 <P>
64                   <TEXTAREA name='certPublic' rows='20' cols='80'>
65               </TEXTAREA>
66                 </P>
67               </td>
68             </tr>
69             <tr>
70               <td width="180">Private Key:</td>
71               <td>
72                 <P>
73                   <TEXTAREA name='certPrivate' rows='20' cols='80'>
74               </TEXTAREA>
75                 </P>
76               </td>
77             </tr>
78           </table>
79         </div>
80         <br>
81         <br>
82         <br>
83         <center>
84           <input type='button' value='Apply' onclick="applyClick()">
85         </center>
86       </form>
87     </blockquote>
88   </body>
89 </html>