Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
PGP encryption and VFP
Message
 
To
08/07/2004 13:55:12
Kam Lee
SUNY-Health Science Center
Brooklyn, New York, United States
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00922125
Message ID:
00922150
Views:
41
I used NSDPGP COM Wrapper to PGP version 8
http://community.wow.net/grt/nsdpgp.html

This solution is free, though I'm not sure whether it is completely legal. You probably should check carefully before using it.

PGP version installed on my computer is 8.0.3. I was able to automate file encryption in a few lines of code:
* cSource -- source file
* cTarget -- target PGP file

#DEFINE TEXT_DATA   0
#DEFINE BINARY_DATA 1

LOCAL cKeyId, cPubring, cSecring, nSourceMode, nTargetMode
* get this value from properties of a key you use for encryption
cKeyId = "0x19A2AAAA"

* change cPubring and cSecring to corresponding locations on your computer
cPubring = "C:\Documents and Settings\User\My Documents\PGP\pubring.pkr"
cSecring = "C:\Documents and Settings\User\My Documents\PGP\secring.pkr"

nSourceMode = TEXT_DATA && depends on the source file format
nTargetMode = BINARY_DATA && either of two modes

oPgp = CreateObject("Nsdpgp3Lib.PGP")

oPgp.EncryptFile(cPubring, cSecring,;
	cSource, cTarget,;
	nSourceMode, nTargetMode, cKeyId)
To enumerate key ids use this code:
LOCAL cPath, cPubring, cSecring, cSrc, cDst
cPath = "C:\Documents and Settings\User\My Documents\PGP\"
cPubring = cPath + 'pubring.pkr'
cSecring = cPath + 'secring.skr'

PRIVATE oPgp As Object
oPgp = CreateObject("Nsdpgp3Lib.PGP")
cKeyId = oPgp.ListKeys(cPubring, cSecring)
? cKeyId
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform