Chilkat HOME ASP Visual Basic VB.NET C# Visual C++ C MFC Delphi FoxPro Java Perl PHP Python Ruby SQL Server VBScript
|
Serialize Certificate to/from a String ASP 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("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 "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("ChilkatCertificate.ChilkatCert")
cert2.SetFromEncoded(encodedCert)
Response.Write "Re-created: " & cert2.SubjectDN
end if
%>
</body>
</html>
|
Need a specific example? Send a request to support@chilkatsoft.com
© 2000-2008 Chilkat Software, Inc. All Rights Reserved.