Question : Automated Install of Root CA Cert using CEnroll in IE

I 'm trying to create an automatic installation of my rootCA on my OWA 2007 website and clients Website. I've seen some VBScript that can load a self-signed certificate into the certificate registry, all the user has to do is visit the page.
 Here is what i have found so far-->
1) Export you certificate as PKCS-7 format to a file.
2) Base64 the contents.
3) paste the Base64 contents into the 'credentials' below (you'll have many more lines than this), save the page and load it in IE
4) Click 'yes' and 'yes' when prompted.
5) Certificate should be loaded, verify by viewing the encrypted site.


Found from:
http://forums.iis.net/t/1148908.aspx
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:


Install Root Certificate using CEnroll Active-X component and PKCS-7

 
 

Answer : Automated Install of Root CA Cert using CEnroll in IE

I have solved the problem. Here is the code.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
<HTML>
<HEAD>
<TITLE>Installing A Root Certificate</TITLE>
<BR>Root Certificate Authority Installation
<BR>
<BR>
 
<%@ LANGUAGE="VBScript"%>
<%
Set fs = CreateObject("Scripting.FileSystemObject")
Set MyFile = fs.OpenTextFile("C:\BASE64.cer", 1)
 
Output = ""
 
Do While MyFile.AtEndOfStream <> true
  line = Chr(34) & MyFile.ReadLine & Chr(34)
  If MyFile.AtEndOfStream <> true then
    line = line & " & _" & Chr(10)
  End If
  Output = Output & line
Loop
 
MyFile.Close
 
Set MyFile = Nothing
Set fs = Nothing
%>
 
<SCRIPT language="VBSCRIPT">
on error resume next
Dim Str, CEnroll
 
Set CEnroll = CreateObject("CEnroll.CEnroll.1")
Str = <% Response.Write Output %>
 
CEnroll.installPKCS7(Str)
 
Set CEnroll = Nothing
</SCRIPT>
</HEAD>
</HTML>
Random Solutions  
 
programming4us programming4us