Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
|
|
Export a Certificate to a .cer FileASP 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("Chilkat.CreateCS")
' 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>
|
© 2000-2012 Chilkat Software, Inc. All Rights Reserved.