diff options
Diffstat (limited to 'pki/linux/ra-ui/shared/docroot/ee/user/user.vm')
-rw-r--r-- | pki/linux/ra-ui/shared/docroot/ee/user/user.vm | 286 |
1 files changed, 286 insertions, 0 deletions
diff --git a/pki/linux/ra-ui/shared/docroot/ee/user/user.vm b/pki/linux/ra-ui/shared/docroot/ee/user/user.vm new file mode 100644 index 000000000..a4f50dbcd --- /dev/null +++ b/pki/linux/ra-ui/shared/docroot/ee/user/user.vm @@ -0,0 +1,286 @@ +<!-- --- 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 --- --> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> + +<OBJECT + classid="clsid:127698e4-e730-4e5c-a2b1-21490a70c8a1" + CODEBASE="/ee/xenroll.dll" + id="Enroll"> +</OBJECT> +<title>Certificate System</title> + <link rel="shortcut icon" href="/images/favicon.ico" /> + <link rel="stylesheet" href="/css/pki-base.css" type="text/css" /> + <META http-equiv=Content-Type content="text/html; charset=UTF-8"> + +</head> +<body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366"> + +#include ( "header.vm" ) + +<div id="mainNavOuter"> +<div id="mainNav"> + +<div id="mainNavInner"> + + +<ul> +<li id="mainFirst-active">Certificate System</li> +</ul> + +</div><!-- end mainNavInner --> +</div><!-- end mainNav --> +</div><!-- end mainNavOuter --> + + +<div id="bar"> + +<div id="systembar"> +<div id="systembarinner"> + +<div> + - +</div> + + +</div> +</div> + +</div> + +<SCRIPT LANGUAGE="JavaScript"> + +function validate() +{ + var x = document.enrollment.uid.value; + if (x == '') { + alert("uid is empty"); + return false; + } + var e = document.enrollment.email.value; + if (e == '') { + alert("email is empty"); + return false; + } + var cn = document.enrollment.cn.value; + if (cn == '') { + alert("Full name is empty"); + return false; + } + var dn = "uid="+x+",e="+e+",cn="+cn; + with (document.forms[0]) { + crmfObject = crypto.generateCRMFRequest( + dn, + "regToken", "authenticator", + null, + "setCRMFRequest();", + 1024, null, "rsa-dual-use"); + return false; + } +} + +function setCRMFRequest() +{ + with (document.forms[0]) { + csr.value = crmfObject.request; + submit(); + } +} + +</SCRIPT> + + +<font size="+1" face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif"> +<a href="/ee/index.cgi">RA Services</a> : +<a href="/ee/user/index.cgi">User Enrollment</a><br /> +User Interface +</font><br> +<p> +This form is for user to request for an end-user certificate. +<p> +<script language=javascript> +<!-- + if (navigator.appName == "Microsoft Internet Explorer") { + document.writeln('<form name="enrollment" method=post action="submit.cgi">'); + } else { + document.writeln('<form name="enrollment" onSubmit="return validate();" method=post action="submit.cgi">'); + } +--> +</script> +<SCRIPT LANGUAGE=VBS> +<!-- + +Sub Send_OnClick + Dim TheForm + Dim szName + Dim options + Set TheForm = Document.enrollment + + ' Contruct the X500 distinguished name + szName = "0.9.2342.19200300.100.1.1=" & TheForm.uid.Value & ",E=" & TheForm.email.Value & ",CN=" & TheForm.cn.Value + + On Error Resume Next + Enroll.HashAlgorithm = "MD5" + Enroll.KeySpec = 1 + + ' Pick the provider that is selected + set options = TheForm.all.cryptprovider.options + index = options.selectedIndex + Enroll.providerType = options(index).value + Enroll.providerName = options(index).text + + ' adding 2 to "GenKeyFlags" will enable the 'High Security' + ' (USER_PROTECTED) mode, which means IE will pop up a dialog + ' asking what level of protection you would like to give + ' the key - this varies from 'none' to 'confirm password + ' every time the key is used' + Enroll.GenKeyFlags = 1 ' key PKCS12-exportable + szCertReq = Enroll.createPKCS10(szName, "1.3.6.1.5.5.7.3.2") + theError = Err.Number + On Error Goto 0 + ' + ' If the user has cancelled things the we simply ignore whatever + ' they were doing ... need to think what should be done here + ' + If (szCertReq = Empty AND theError = 0) Then + Exit Sub + End If + + If (szCertReq = Empty OR theError <> 0) Then + ' + ' There was an error in the key pair generation. The error value + ' is found in the variable 'theError' which we snarfed above before + ' we did the 'On Error Goto 0' which cleared it again. + ' + sz = "The error '" & Hex(theError) & "' occurred." & chr(13) & chr(10) & "Your credentials could not be generated." + result = MsgBox(sz, 0, "Credentials Enrollment") + Exit Sub + End If + + TheForm.csr.Value = szCertReq + + ' TheForm.Submit + Exit Sub + +End Sub + +--> +</SCRIPT> +<center> +<table border="0" cellspacing="1" cellpadding="1"> +<tr> + <td>UID:</td> + <td><input type=text name=uid value=""></td> +</tr> +<tr> + <td>Full Name:</td> + <td><input type=text name=cn value=""></td> +</tr> +<tr> + <td>Site ID:</td> + <td><input type=text name=site_id value=""></td> +</tr> +<tr> + <td>Your Email:</td> + <td><input type=text name=email value=""></td> +</tr> +<tr> +</tr> +<tr> + <td> </td> + <td> </td> +</tr> +<script language=javascript> +<!-- + if (navigator.appName == "Microsoft Internet Explorer") { + document.writeln('<SELECT NAME=\"cryptprovider\"></SELECT>'); + } +--> +</script> +<tr> + <td> +<script language=javascript> +<!-- + if (navigator.appName == "Microsoft Internet Explorer") { + document.writeln('<input type=hidden name=csr_type value="pkcs10">'); + document.writeln('<input type=submit Name=Send value="Submit">'); + } else { + document.writeln('<input type=hidden name=csr_type value="crmf">'); + document.writeln('<input type=submit name=Submit value="Submit">'); + } +--> +</script> + </td> + <td></td> +</tr> +</table> +</center> +<input type=hidden name="csr" value=""> +<SCRIPT LANGUAGE=VBS> +<!-- +FindProviders + +Function FindProviders + Dim i, j + Dim providers() + i = 0 + j = 1 + Dim el + Dim temp + Dim first + Dim TheForm + Set TheForm = document.enrollment + On Error Resume Next + first = 0 + + Do While True + temp = "" + Enroll.providerType = j + temp = Enroll.enumProviders(i,0) + If Len(temp) = 0 Then + If j < 1 Then + j = j + 1 + i = 0 + Else + Exit Do + End If + Else + set el = document.createElement("OPTION") + el.text = temp + el.value = j + If temp = "Microsoft Base Cryptographic Provider v1.0" Then + first = j + End If + TheForm.cryptprovider.add(el) + If first = 0 Then + first = 1 + TheForm.cryptprovider.selectedIndex = 0 + Else + TheForm.cryptprovider.selectedIndex = first + End If + i = i + 1 + End If + Loop +End Function +--> +</SCRIPT> +</form> +#include ( "footer.vm" ) + +</body> +</html> |