ASP Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

ASP Examples

ASP String
ASP Byte Array
Bounced Mail
Bz2
Character Encoding
CSV
Digital Certificates
Digital Signatures
Email
FTP
HTML-to-XML
HTTP
IMAP
Encryption
MHT / HTML Email
POP3
RSA
S/MIME
SMTP
Socket
Spider
SSH
SSH Tunnel
SSH Key
SFTP
Tar
ASP Upload
XML
XMP
Zip Compression

More Examples...
Email Object
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA

Unreleased...
Bzip2
LZW
Icon

 

 

 

 

 

 

PFX to PEM (Certificate and Private Key Files)

Export a certificate and private key from a PFX to a pair of PEM files.

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%

set certStore = Server.CreateObject("Chilkat.CertStore")

'  Load the PFX file into a certificate store object

password = "myPassword"
success = certStore.LoadPfxFile("chilkat.pfx",password)
If (success <> 1) Then
    Response.Write certStore.LastErrorText & "<br>"

End If

'  Find the cert to be exported by the subject:

' cert is a Chilkat.Cert
Set cert = certStore.FindCertBySubject("Chilkat Software, Inc.")
If (cert Is Nothing ) Then
    Response.Write "Certificate not found." & "<br>"

End If

'  Does this cert have a private key?
If (cert.HasPrivateKey() = 1) Then

    '  Get the private key.

    ' pvkey is a Chilkat.PrivateKey
    Set pvkey = cert.ExportPrivateKey()

    '   Export the private key to a PEM file:
    success = pvkey.SaveRsaPemFile("chilkat_pkey.pem")
    If (success <> 1) Then
        Response.Write pvkey.LastErrorText & "<br>"

    End If

End If

'  Save the cert to a PEM file:
success = cert.ExportCertPemFile("chilkat_cert.pem")
If (success <> 1) Then
    Response.Write cert.LastErrorText & "<br>"

End If


%>
</body>
</html>

 

Need a specific example? Send a request to support@chilkatsoft.com

© 2000-2008 Chilkat Software, Inc. All Rights Reserved.