CryptoSys PKI Pro Manual

Using with C++ (STL)

The C++ (STL) interface to CryptoSys PKI is an interface to diCrPKI.dll for C++ programmers using STL (C++11 or above).

Required files to compile in a C++ project:

dipki.hpp
diCrPKI.h
dipki.cpp
   #include "diCrPKI.h"
   #include "dipki.hpp"
{main}.cpp
   #include "dipki.hpp"
   int main() { ... }

Link to diCrPKI.lib. In MSVC++, with the LIB file in the output directory (typically Debug or Release)

Configuration Properties > Linker > Input > Additional Dependencies: $(OutDir)diCrPKI.lib;%(AdditionalDependencies)

A minimal example dipki-cpp-min.cpp

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

Using the command-line with MSVC:

CL dipki-cpp-min.cpp dipki.cpp /EHsc /link ..\debug\diCrPKI.lib

Using GCC (make sure the DLL has been compiled for target X64):

g++ -std=c++11 dipki-cpp-min.cpp dipki.cpp "C:\fullpath\to\x64\Debug\diCrPKI.lib"

See the detailed on-line programmer's reference.

Note: All the C++ methods are static and are called directly without creating any object.

[PREV: Examples of C code...]   [Contents]   [Index]   
   [NEXT: Using with .NET: C# and VB.NET...]

Copyright © 2004-24 D.I. Management Services Pty Ltd. All rights reserved. Generated 2024-09-23T07:52:09Z.