CryptoSys API Library Manual

Conventions in this document

Code in classic Visual Basic (VB6/VBA) is shown shaded as follows:-

Dim strData As String
Dim nRet As Long
strData = "Hello world"
Debug.Print strData

Code in C/C++ is shown as:

char *str = "Hello world";
printf("%s\n", str);

Code in VB.NET (VB200x) is shown as:

Dim nDataLen As Integer
Dim abData() As Byte
If strData.Length = 0 Then Exit Function
abData = System.Text.Encoding.Default.GetBytes(strData)
nDataLen = abData.Length

Code in C# is shown as:

public static string ToHex(byte[] binaryData)
{
   int nBytes = binaryData.Length;
   Int32 nChars = 2 * nBytes;
   if (nBytes == 0) return String.Empty;
   StringBuilder sb = new StringBuilder(nChars);
   nChars = CNV_HexStrFromBytes(sb, nChars, binaryData, nBytes);
   return sb.ToString(0, nChars);
}

Code in VBScript/ASP is shown as:

Dim oGen
Set oGen = Server.CreateObject("diCryptOCX.gen")
Response.Write "Version=" & oGen.Version & Chr(13) & Chr(10)

Output from code samples is shown as:

Result=OK

All functions called directly in the CryptoSys API begin with 3 or 4 capital letters followed by an underscore "_", e.g.

nRet = API_ErrorLookup(strMsg, Len(strMsg), nCode)

For VBA users, there are some wrapper functions provided in the module basCryptoSys.bas which avoid the complications of having to pre-dimension strings, etc. These begin with lowercase letters and have no underscore. They are shown in our examples as follows:

strErrMsg = apiErrorLookup(nCode)

[Contents] [Index]

[PREV: Changes in earlier versions...]   [Contents]   [Index]   
   [NEXT: Copyright Notice...]

Copyright © 2001-24 D.I. Management Services Pty Ltd. All rights reserved. Generated 2024-01-07T07:42:00Z.