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.libUsing 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.