![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
Serialize Certificate to/from a StringASP script to serialize a digital certificate to a string, and then later re-create the certificate object from the encoded string. <html>
<head>
<title>Serialize and unserialize a certificate</title>
</head>
<body>
<%
' Get an object to create a certificate store object
set ccs = Server.CreateObject("Chilkat_9_5_0.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 "Found certificate: " & cert.SubjectDN & "<br>"
' Serialize the certificate to a string.
encodedCert = cert.GetEncoded()
Response.write "Encoded: " & encodedCert & "<br>"
' Re-create the certificate object from an encoded string.
set cert2 = Server.CreateObject("Chilkat_9_5_0.Cert")
cert2.SetFromEncoded(encodedCert)
Response.Write "Re-created: " & cert2.SubjectDN
end if
%>
</body>
</html>
|
© 2000-2026 Chilkat Software, Inc. All Rights Reserved.