home *** CD-ROM | disk | FTP | other *** search
- <%Response.Expires=0%>
- <HTML>
- <HEAD>
- <TITLE>Web Server Enrollment Page</TITLE>
- <META HTTP-EQUIV="Cache-Control" CONTENT="no cache">
- <META HTTP-EQUIV="Pragma" CONTENT="no cache">
- <META HTTP-EQUIV="Expires" CONTENT="0">
-
-
- <%
- ''Process a Certificate Request
-
- On Error Resume Next
-
- Dim Certificate, DispositionCode, LastStatus,ConfigString, PKCS10
- Dim SubmitFlag, GetCertFlag, Attributes, ControlType, CPUType
-
- set ICertRequest = Server.CreateObject("CertificateAuthority.Request")
- set ICertConfig = Server.CreateObject("CertificateAuthority.Config")
-
- ConfigString = ICertConfig.GetConfig(0)
- PKCS10 = Request.Form("RequestData")
- SubmitFlag = Request.Form("SubmitFlag")
- GetCertFlag = Request.Form("GetCertFlag")
- Attributes = Request.Form("CertAttrib")
- ControlType = Request.Form("ControlType")
-
- DispositionCode = ICertRequest.Submit(SubmitFlag, PKCS10, Attributes, ConfigString)
-
- LastStatus = 0
- LastStatus = ICertRequest.GetLastStatus()
- Certificate = ICertRequest.GetCertificate(GetCertFlag)
-
- Session("CertStore") = Certificate
- %>
-
-
- <% if ControlType = "" then %>
- <SCRIPT LANGUAGE="JAVASCRIPT">
- function Download() {
- window.location = "newcert.cer";
- }
- </SCRIPT>
-
- <% else
-
- ''Format the Certificate
-
- FormatedCert = ""
- qc = chr(34)
- CharsLeft = True
- OutP = 1
-
- while(CharsLeft)
- BeginLine = OutP
- OutP = InStr(OutP, Certificate, vbNewLine)
-
- if (OutP > 0) then
- FormatedCert = FormatedCert & "szPKCS7 = szPKCS7 & " & qc & _
- Mid(Certificate, BeginLine, OutP-BeginLine) & qc
-
- if (OutP >= (len(Certificate) - len(vcNewLine))) then
- CharsLeft = False
- end if
-
- else
- CharsLeft = False
- end if
- FormatedCert = FormatedCert & vbNewLine
- OutP = OutP + len(vbNewLine)
- wend
-
- end if %>
-
-
- <% if ControlType = "XENROLL" or ControlType = "CERTENR3" then %>
-
- <% if ControlType = "XENROLL" then %>
- <OBJECT
- classid="clsid:43F8F289-7A20-11D0-8F06-00C04FC295E1"
- CODEBASE="/CertControl/<%=Request.Form("CPUType")%>/xenroll.dll"
- id=IControl
- >
- </OBJECT>
- <% else %>
- <OBJECT
- classid="clsid:33BEC9E0-F78F-11cf-B782-00C04FD7BF43"
- CODEBASE="/CertControl/x86/certenr3.dll"
- id=IControl
- >
- </OBJECT>
- <% end if %>
-
- <SCRIPT LANGUAGE="VBSCRIPT">
- sub Download()
-
- Dim result, Message
-
- On Error Resume Next
-
- szPKCS7 = ""
- <%=FormatedCert%>
-
- <% if StrComp(ControlType, "XENROLL", 1) = 0 then %>
- IControl.AcceptPKCS7(szPKCS7)
- <% else %>
- szSessionID = "<%=Request.Form("PassThru") %>"
- Result = IControl.AcceptCredentials(szSessionID, szPKCS7, 0, FALSE)
- <% end if %>
- If err.Number = 0 Then
- <% if ControlType = "XENROLL" then %>
- Message = "Your new certificate has been successfully installed. " & vbcrlf & vbcrlf
- Message = Message & " If you are using IE3.02 or IE4.0 Preview 2 and you"
- Message = Message & " have not already installed this Certificate"
- Message = Message & " Authority's Root Certificate, you must do so from the"
- Message = Message & " 'Install Certificate Authority Certificates'"
- Message = Message & " page."
- result = MsgBox (Message, 0, "Certificate Server")
- window.location = "default.htm"
- <% else %>
- Message = "Your new certificate has been successfully installed."
- result = MsgBox (Message, 0, "Certificate Server")
- window.location = "default.htm"
- <% end if %>
- Else
- Message = "Unable to install the certificate." & _
- vbNewLine & vbNewLine & "Error: " & Hex(err)
- result = MsgBox (Message, 48, "<%=ControlType%>")
- End If
- end sub
- </SCRIPT>
-
- <% end if %>
-
-
- <Body Background="csback.gif">
- <BODY BGCOLOR=#FFFFFF>
- <B><A HREF="../default.htm">HOME</A></B>
- <HR>
-
- <UL><IMG SRC="cslogo.gif" ALIGN="MIDDLE" border=0 alt="Product Logo"></UL>
-
- <Center>
-
- <% if DispositionCode = 3 then %>
-
- <H1>Certificate Download</H1>
- <B>
- <FONT SIZE=5>
- <BR>Your request has been successfully processed!
- </FONT>
- <FONT SIZE=4>
- <BR><BR><BR><BR><BR>Please click the Download button to obtain your new certificate.
- <BR><BR>
- </FONT>
- <FORM>
- <INPUT TYPE=BUTTON VALUE="Download" NAME="Certificate" OnClick="Download()">
- </FORM>
- <BR><BR><BR><BR><BR>
-
- <% else %>
-
- <H1>Error!!!</H1>
- <B>
- <FONT SIZE=5>
-
- Certificate Server is unable to process your request.
- </FONT>
- <BR><BR><BR>
- <FONT SIZE=4>
- <I>
- Last Status Error Code = <%=LastStatus%>
- </I>
- </FONT>
- <FONT SIZE=5>
- <BR><BR><BR>
- Please insure that you are submiting a valid request or contact
- <BR>your Certificate Authority for assistance.
- </FONT>
- </B>
- <BR><BR><BR><BR>
-
- <% end if %>
-
- </CENTER>
-
- <!--FOOTER START-->
- <HR>
- <HR>
- <FORM>
- <i>© 1997 by Microsoft Corporation. All rights reserved.</i>
- </FORM>
- <!--FOOTER END-->
-
-
- </BODY>
- </HTML>
-
-
-
-
-
-
-
-
-
-