* 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