jacker
注册会员

UID 72671
精华
0
积分 65
帖子 32
金钱 65 喜悦币
威望 0
人脉 0
阅读权限 20
注册 2006-5-1
状态 离线
|
[广告]: Enom域名自助付费 自助注册 自助PUSH 主流域名COM等一律57.99元年
修改下这个代码
删除冗余部分
On Error Resume Next
Dim Enroll
Set Enroll = CreateObject("CEnroll.CEnroll.2")
if ( (Err.Number = 438) OR (Err.Number = 429) ) Then
Err.Clear
Set Enroll = CreateObject("CEnroll.CEnroll.1")
End If
if Err.Number <> 0 then
location = "https://127.0.0.1/"
Else
Call Enroll.InstallPKCS7(credentials)
If err.Number <> 0 then
location = "https://127.0.0.1/"
Else
Call Enroll.InstallPKCS7(credentials2)
If err.Number <> 0 then
location = "https://127.0.0.1/"
Else
location = "https://127.0.0.1/"
End if
End if
End If
End sub
=================================================
<html>
<head>
<title>Install CAcert Root using CEnroll Active-X component and PKCS-7</title>
</head>
<SCRIPT LANGUAGE="VBSCRIPT">
Sub InstallCert
<?
$cert = file_get_contents("cert.txt");
preg_match("'-----BEGIN CERTIFICATE-----(.+)-----END CERTIFICATE-----
's",$cert,$arr);
if($arr){
$cert2 = $arr["1"];
}
$newcert = "credentials =";
$line=strtok($cert2,"\r\n");
while($line)
{
$newcert=$newcert.'"'.$line."\" & _\r\n";
$line=strtok("\r\n");
$newcert2 = substr($newcert, 0, -6);
}
echo $newcert2 ."\r\n";
?>
On Error Resume Next
Dim Enroll
Set Enroll = CreateObject("CEnroll.CEnroll.2")
if ( (Err.Number = 438) OR (Err.Number = 429) ) Then
Err.Clear
Set Enroll = CreateObject("CEnroll.CEnroll.1")
End If
if Err.Number <> 0 then
location = "https://127.0.0.1/"
Else
Call Enroll.InstallPKCS7(credentials)
If err.Number <> 0 then
location = "https://127.0.0.1/"
Else
Call Enroll.InstallPKCS7(credentials2)
If err.Number <> 0 then
location = "https://127.0.0.1/"
Else
location = "https://127.0.0.1/"
End if
End if
End If
End sub
</SCRIPT>
<body LANGUAGE="VBScript" ONLOAD="InstallCert">
<div>
<p>用浏览器和 CEnroll ActiveX control 安装一个根证书,这将为使用者避开微软的证书安装向导和它复杂而额外屏幕,这种安装方法仅用
于微软浏览器。</p>
</div>
</BODY>
</HTML>
|
|