Chilkat HOME ASP Visual Basic VB.NET C# Visual C++ C MFC Delphi FoxPro Java Perl PHP Python Ruby SQL Server VBScript
|
Export a Certificate to a .cer File ASP script to export a certificate to a .cer certificate file. <html>
<head>
<title>Export a Certificate to a .cer File</title>
</head>
<body>
<%
' Get an object to create a certificate store object
set ccs = Server.CreateObject("ChilkatCertificate.ChilkatCreateCS")
' Open the local machine certificate store.
set certStore = ccs.OpenLocalSystemStore()
' Find the certificate matching the email address "matt@chilkatsoft.com"
set cert = certStore.FindCertBySubjectE("matt@chilkatsoft.com")
if (cert is Nothing) then
Response.write "Certificate not found!"
else
Response.write "Saving certificate: " & cert.SubjectDN & "<br>"
' Serialize the certificate to a string.
encodedCert = cert.GetEncoded()
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.CreateTextFile("c:\temp\myCert.cer",true)
f.WriteLine(encodedCert)
f.Close
set f=nothing
set fs=nothing
end if
%>
</body>
</html>
|
Need a specific example? Send a request to support@chilkatsoft.com
© 2000-2008 Chilkat Software, Inc. All Rights Reserved.