FoxPro Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

Visual FoxPro Examples

Bounced Mail
Character Encoding
Digital Certificates
Digital Signatures
Email
FTP
HTML-to-XML
HTTP
IMAP
Encryption
MHT / HTML Email
RSA Encryption
S/MIME
Socket
Spider
String
Tar
Upload
XML
XMP
Zip Compression
Self-Extractor

More Examples...
Email Object
POP3
SMTP
RSS
Atom
Byte Array
Service
PPMD
Deflate
DH Key Exchange
DSA

Unreleased...
Bzip2
LZW
Bz2
Icon

 

Non-Chilkat Links
Text and String Handling

Decrypt MIME with PFX

Demonstrates how to decrypt MIME using a PFX (containing a digital certificate with private key). The content-type of an encrypted MIME message looks like this:

Content-Type: application/x-pkcs7-mime;
	name="smime.p7m"

LOCAL loMime
LOCAL lnSuccess
LOCAL loCertStore
LOCAL loCert
LOCAL loPrivKey

loMime = CreateObject('Chilkat.Mime')

lnSuccess = loMime.UnlockComponent("Anything for 30-day trial")
IF (lnSuccess = 0) THEN
    =MESSAGEBOX("Failed to unlock component")
    QUIT
ENDIF

lnSuccess = loMime.LoadMimeFile("encryptedEmail.eml")
IF (lnSuccess <> 1) THEN
    ? loMime.LastErrorText
    QUIT
ENDIF

loCertStore = CreateObject('Chilkat.CertStore')
lnSuccess = loCertStore.LoadPfxFile("myPfx.pfx","myPfxPassword")
IF (lnSuccess <> 1) THEN
    ? loCertStore.LastErrorText
    QUIT
ENDIF

*  Find the certificate by email address.  There are many
*  ways to find certificates within a Chilkat certificate store
*  object...

loCert = loCertStore.FindCertBySubjectE("support@chilkatsoft.com")
IF (loCert = NULL ) THEN
    ? loCertStore.LastErrorText
    QUIT
ENDIF

loPrivKey = loCert.ExportPrivateKey()
IF (loPrivKey = NULL ) THEN
    ? loCert.LastErrorText
    RELEASE loCert
    QUIT
ENDIF

lnSuccess = loMime.Decrypt2(loCert,loPrivKey)
IF (lnSuccess <> 1) THEN
    ? loMime.LastErrorText
    QUIT
ENDIF

*  Show the decrypted MIME:
? loMime.GetMime()

RELEASE loCert
RELEASE loPrivKey


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

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

Mail Component · .NET Email Component · ASP Mail Component · XML Parser