We don't use FoxPro ourselves, but it is possible to call all the functions in our cryptographic products
CryptoSys API, CryptoSys PKI and
FirmaSAT
from FoxPro. This page explains what we know.
If anyone has any corrections or would like to send in examples of working FoxPro declarations, we'd be delighted
to hear from you.
Please send us a message.
Thanks to Hugo Chavez and Hugo Sols for their FoxPro code examples for FirmaSAT
and Bálint Korpa for his SHA-3-512 example for CryptoSys API.
For more info on creating interfaces see Writing an interface in another programming language.
As far as we know, all the DECLARE
statements can be done using only [@]STRING
and INTEGER
types.
Where a "long" is used in CryptoSys PKI, use a FoxPro INTEGER
.
The "long" type in VB6 and C is a 32-bit signed integer.
As far as FoxPro is concerned, CryptoSys API, CryptoSys PKI and FirmaSAT treat both a string and a byte array identically, except a string must have an extra zero character at the end and a byte array does not, but the length of the byte array must be specified separately. Any extra bytes passed by the FoxPro function will be ignored. Only ANSI strings with single 8-bit characters are used in CryptoSys, not Unicode.
We believe that FoxPro may automatically add an extra CHR(0)
to the end of a STRING
when passing to a DLL and so you may need to dimension your variable with an extra character at the end (see the second web site below).
It certainly does not hurt to have your STRING types dimensioned to a greater length than required,
provided either (a) a string is terminated with a zero byte or (b) the correct length for the byte array is specified in the length parameter.
We recommend that you use the C interfaces in the
diCryptoSys.h
,
diCrPKI.h
and
diFirmaSat2.h
include files rather than the VB6 ones to derive the FoxPro declare statements.
You should note that the only difference in type between a "string" and a "byte array"
is that the former is char *str
and the latter is unsigned char *b
.
These should both be STRING
types as far as FoxPro is concerned.
The strings and byte arrays marked "const" in the C declaration are not changed,
but the ones without const are meant to accept output so presumably need the @ prefix in FoxPro.
These two web sites should be helpful:
Using the first web site (now defunct, sorry) and the .h include files,
should enable you to write the correct DECLARE
statements to use
CryptoSys API, CryptoSys PKI and
FirmaSAT
with FoxPro.
long _stdcall HASH_HexFromBytes( char *szOutput, long nMaxChars, const void *lpMessage, long nMsgLen, long nOptions);
DECLARE INTEGER HASH_HexFromBytes IN diCrPKI.dll; STRING @szOutput,; INTEGER nMaxChars,; STRING lpMessage,; INTEGER nMsgLen,; INTEGER nOptions
It is possible that the reference to a byte array (unsigned char*
or void *
) may be passed as an INTEGER
type
instead of STRING
.
Our CryptoSys products are offered primarily with interfaces using the C/C++, C#, VB6/VBA and VB.NET languages. We don't use or offer to support any other interfaces. We will try and help if we can. We haven't checked anything on this page ourselves. Please make whatever checks you need to before purchase.
For more information or to comment on this page, please send us a message.
This page last updated 10 September 2025
Comments by Users