FoxPro Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CUnicode C++Unicode CMFCDelphi DLLDelphi ActiveXFoxProJavaPerlPHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

Visual FoxPro Examples

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

More Examples...
Amazon S3
DKIM / DomainKey
NTLM
RSS
Atom
Byte Array
Service
PPMD
Deflate
DH Key Exchange
DSA
FileAccess
Bzip2
LZW

 

Non-Chilkat Links
Text and String Handling

(Visual FoxPro) Generate new DSA Key from OpenSSL Parameters File

Generates a new DSA key from an OpenSSL-created parameters file (DER and PEM formats supported). Examples of using OpenSSL to create parameter files are shown here:

openssl dsaparam -outform DER 1024 <  seedData.txt >dsaparam.der

openssl dsaparam 1024 < seedData.txt >dsaparam.pem

Download Chilkat DSA ActiveX

LOCAL lnSuccess
LOCAL loDsa
LOCAL lcPemStr
LOCAL lcXmlStr
LOCAL lnBPublicOnly



loDsa = CreateObject('Chilkat.Dsa')

lnSuccess = loDsa.UnlockComponent("Anything for 30-day trial")
IF (lnSuccess <> 1) THEN
    =MESSAGEBOX(loDsa.LastErrorText)
    QUIT
ENDIF

lnSuccess = loDsa.GenKeyFromParamsDerFile("dsaparam.der")
IF (lnSuccess <> 1) THEN
    =MESSAGEBOX(loDsa.LastErrorText)
    QUIT
ENDIF

*  To generate a key from PEM, call GenKeyFromParamsPem
*  (for an in-memory PEM string) or GenKeyFromParamsFilePem
*  for a PEM file.

*  The public and private keys may now be exported to PEM, DER,
*  and XML formatted files.

*  First for the public key...
*  The public key never needs to be encrypted.

*  Save the public key in PEM format:
lcPemStr = loDsa.ToPublicPem()
*  This example will not check the return value of SaveText...
lnSuccess = loDsa.SaveText(lcPemStr,"dsa_pub.pem")

*  Save the public key in DER format:
lnSuccess = loDsa.ToPublicDerFile("dsa_pub.der")

lnBPublicOnly = 1
*  Save to XML
lcXmlStr = loDsa.ToXml(lnBPublicOnly)
lnSuccess = loDsa.SaveText(lcPemStr,"dsa_pub.xml")

*  ------------------------------------
*  Now for the private key....
*  ------------------------------------

*  Unencrypted PEM:
lcPemStr = loDsa.ToPem()
lnSuccess = loDsa.SaveText(lcPemStr,"dsa_priv.pem")

*  Encrypted PEM:
lcPemStr = loDsa.ToEncryptedPem("myPassword")
lnSuccess = loDsa.SaveText(lcPemStr,"dsa_privEncrypted.pem")

*  DER:
lnSuccess = loDsa.ToDerFile("dsa_priv.der")

*  XML:
lnBPublicOnly = 0
lcXmlStr = loDsa.ToXml(lnBPublicOnly)
lnSuccess = loDsa.SaveText(lcPemStr,"dsa_priv.xml")

=MESSAGEBOX("Finished!")

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