CryptoSys API Library Manual

Using with C++ (STL)

The C++ (STL) interface to the CryptoSys API is an interface to diCryptoSys.dll for C++ programmers using STL (C++11 or above).

Required files to compile in a C++ project:

crsysapi.hpp
diCryptoSys.h
crsysapi.cpp
  #include "diCryptoSys.h"
  #include "crsysapi.hpp"
{main}.cpp
  #include "crsysapi.hpp"
  int main() { ... }

You must link to diCryptoSys.lib. In MSVC++ IDE, use Project > Properties > Linker > Input > Additional Dependencies and add the full path to diCryptoSys.lib. E.g.

Additional Dependencies = $(OutDir)diCryptoSys.lib;%(AdditionalDependencies)
Using the command-line with MSVC:
CL test.cpp crsysapi.cpp /link ..\Debug\diCryptoSys.lib
Using GCC (make sure the DLL has been compiled for target X64):
g++ -std=c++11 test.cpp crsysapi.cpp "C:\fullpath\to\x64\Debug\diCryptoSys.lib"

Here is a simple C++ (STL) program for testing.

#include <iostream>
#include "crsysapi.hpp"
int main()
{
    std::cout << "Gen::Version=" << crsysapi::Gen::Version() << std::endl;
}

See the detailed on-line programmer's reference.

Note: Almost all C++ methods are static and can be called directly without creating any object. Those few methods that do need an object only use them to keep state between Init/Update/Final calls. These objects are not intended to be used for inheritance or any other clever OO stuff. Only create and use one at a time.

[PREV: ANSI C users must add one to this value......]   [Contents]   [Index]   
   [NEXT: Using with .NET: C# and VB.NET...]

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