home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 2000 March
/
VPR0003B.ISO
/
alpha
/
ceaccept.asp
< prev
next >
Wrap
Text File
|
1999-10-14
|
8KB
|
270 lines
<%Response.Expires=0%>
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=x-sjis">
<TITLE>Web サーバー登録ページ</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
set ICertRequest = Server.CreateObject("CertificateAuthority.Request")
set ICertConfig = Server.CreateObject("CertificateAuthority.Config")
ConfigString = ICertConfig.GetConfig(0)
PKCS10 = Request.Form("CertRequest")
SubmitFlag = Request.Form("SubmitFlag")
GetCertFlag = Request.Form("GetCertFlag")
Attributes = Request.Form("CertAttrib")
ControlType = Request.Form("ControlType")
if PKCS10 <> "" then
DispositionCode = ICertRequest.Submit(SubmitFlag, PKCS10, Attributes, ConfigString)
LastStatus = 0
LastStatus = ICertRequest.GetLastStatus()
Certificate = ICertRequest.GetCertificate(GetCertFlag)
Session("CertStore") = Certificate
end if
%>
<% if PKCS10 = "" then %>
<SCRIPT LANGUAGE="VBSCRIPT">
msg = "空の文字列が提出されました。使用しているクライアント マシンで"
msg = msg & "エラーが発生したと考えられます。正しいデータを提出した"
msg = msg & "ことと、クライアント マシンで PKCS #10 が正しく生成"
msg = msg & "されたことを確認してください。"
err = MsgBox(msg, 16, "CERTIFICATE SERVER")
window.navigate ("ceenroll.asp")
</SCRIPT>
<% end if %>
<% 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/xenroll.cab#Version=5,131,1877,1"
id=IControl
>
</OBJECT>
<% else %>
<OBJECT
classid="clsid:33BEC9E0-F78F-11cf-B782-00C04FD7BF43"
CODEBASE="/CertControl/x86/certenr3.dll#Version=4.70.1143"
id=IControl
>
</OBJECT>
<% end if %>
<SCRIPT LANGUAGE="VBSCRIPT">
sub Download()
Dim result, Message
On Error Resume Next
szPKCS7 = ""
<%=FormatedCert%>
<% if ControlType = "XENROLL" then %>
if ("<%=Request.Form("WriteCertToCSP") %>" = "WriteCertToCSP") then
IControl.WriteCertToCSP = TRUE
end if
if "<%=Request.Form("CertUsage")%>" = "1.3.6.1.5.5.7.3.8" or _
"<%=Request.Form("CertUsage")%>" = "1.3.6.1.5.5.7.3.3" then
SPCFile = InputBox("名前を付けて SPC ファイルを保存 : ", "XENROLL")
IControl.SPCFileName = SPCFile
elseif "<%=Request.Form("SaveCert")%>" = "SaveCertificate" then
SPCFile = InputBox("名前を付けて証明書を保存 : ", "XENROLL")
IControl.SPCFileName = SPCFile
end if
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 = "新しい証明書のインストールに成功しました。" & vbcrlf & vbcrlf
Message = Message & "IE 3.02 または IE 4.0 Preview 2 を使用しており、" & vbcrlf
Message = Message & "この証明機関のルート証明書をまだインストール" & vbcrlf
Message = Message & "していない場合は、証明機関の証明書をインストール" & vbcrlf
Message = Message & "するための Web ページを使用して、ルート証明書を" & vbcrlf
Message = Message & "インストールする必要があります。"
result = MsgBox (Message, 64, "Certificate Server")
window.location = "default.htm"
<% else %>
Message = "新しい証明書のインストールに成功しました。"
result = MsgBox (Message, 0, "Certificate Server")
window.location = "default.htm"
<% end if %>
Else
Message = "証明書をインストールできません。" & vbcrlf & vbcrlf
Message = Message & "指定した設定を CSP がサポートしていることと、"
Message = Message & "正しい値を入力したことを確認してください。" & vbcrlf & vbcrlf
Message = Message & "エラー : " & Hex(err)
result = MsgBox (Message, 48, "<%=ControlType%>")
window.location = "ceenroll.asp"
End If
end sub
</SCRIPT>
<% end if %>
<Body Background="csback.gif">
<BODY BGCOLOR=#FFFFFF>
<B><A HREF="../default.htm">ホーム</A></B>
<HR>
<UL><IMG SRC="cslogo.gif" ALIGN="MIDDLE" border=0 alt="製品のロゴ"></UL>
<Center>
<% if DispositionCode = 3 then %>
<H1>証明書のダウンロード</H1>
<B>
<FONT SIZE=5>
<BR>要求は正常に処理されました。
</FONT>
<FONT SIZE=4>
<BR><BR><BR><BR><BR>新しい証明書を取得するには [ダウンロード] ボタンをクリックしてください。
<BR><BR>
</FONT>
<FORM>
<INPUT TYPE=BUTTON VALUE="ダウンロード" NAME="Certificate" OnClick="Download()">
</FORM>
<BR><BR><BR><BR><BR>
<% else %>
<H1>エラー !</H1>
<B>
<FONT SIZE=5>
Certificate Server は要求の処理に失敗しました。
</FONT>
<BR><BR><BR>
<FONT SIZE=4>
<I>
最後に発生したエラーのコード = <%=HEX(LastStatus)%>
</I>
</FONT>
<BR><BR>
<% if LastStatus = 1722 then %>
<FONT SIZE=4>
このエラーは、Certificate Authority (証明機関) サービスが開始されていない<BR>
場合に発生します。<BR>
</FONT>
<BR><BR>
<FONT SIZE=5>
証明機関に相談してください。
</FONT>
<% elseif LastStatus = -2146893811 then %>
<FONT SIZE=4>
証明機関のキーに問題がある可能性があります。<BR>
キーを発見できなかったため、証明書は発行されませんでした。<BR>
</FONT>
<BR><BR>
<FONT SIZE=5>
証明機関に相談してください。
</FONT>
<% elseif LastStatus = 87 then %>
<FONT SIZE=4>
不正なデータが Certificate Server に提出されました。<BR>
原因は 2 つ考えられます。提出した要求の形式が不正であるか、<BR>
Certificate Server の構成時に、"共有フォルダ" に<BR>
ネットワーク共有または相対パスを指定しました。
</FONT>
<BR><BR>
<FONT SIZE=5>
証明機関に相談してください。
</FONT>
<% elseif LastStatus = -2147024883 then %>
<FONT SIZE=4>
提出した要求のエンコード長が 7F である可能性があります。<BR>
共通名、部署などに入力したデータの "長さ" を変更し、<BR>
この証明書を再度要求してください。
</FONT>
<BR><BR><BR>
<FONT SIZE=5>
それでも問題が解消しない場合は、証明機関に連絡してください。
</FONT>
<% else %>
<FONT SIZE=5>
<BR><BR>
提出した要求が正しいことを確認し、問題が解消しない場合は
<BR>証明機関に相談してください。
</FONT>
<% end if %>
</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>