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
|
|
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.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.Cert")
cert2.SetFromEncoded(encodedCert)
Response.Write "Re-created: " & cert2.SubjectDN
end if
%>
</body>
</html>
|
© 2000-2012 Chilkat Software, Inc. All Rights Reserved.