Newer
Older
Vereign C++ Client Library allows for digitally signing emails and documents, data encryption,
and key-based authentication.
FIXME: Add more info about the software architecture.
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
## Build
The project uses git submodules for the gRPC protobuf definitions.
So after cloning run `git submodule update --init`.
The protobuf definitions and the generated C++ gRPC client/server are located in
[https://code.vereign.com/code/vcl-proto](https://code.vereign.com/code/vcl-proto) project and
are added as submodule at `proto` subdir.
### Windows
You need Visual Studio 2019 or alternatively install just the build tools and c++ compiler - go to
[https://visualstudio.microsoft.com/downloads/](https://visualstudio.microsoft.com/downloads/)
then scroll and open `Tools for Visual Studio 2019` and download/install `Visual Studio Build Tools 2019`.
The 2019 build tools include cmake, and currently it is 3.16.19112601-MSVC_2.
They also include Ninja build tool.
**NOTE: Currently only builds with Ninja are tested under Windows**
#### Build the third party dependencies
Go to the `vcl/cpp` directory.
First configure the cmake build.
Open `x64 Native Tools Command Prompt` it is preconfigured with all the needed tools including cmake
and ninja.
```shell
> mkdir cmake-build-vendor-debug
> cd cmake-build-vendor-debug
> cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug ../vendor
```
Next build the dependencies.
Note that this will take a while, and that it could be slowed a lot by the windows defender.
You can configure the windows defender to the project directory.
```shell
> ninja
```
#### Build the vereign library
Go to the `vcl/cpp` directory.
```
> mkdir cmake-build-debug
> cd cmake-build-debug
> cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug ..
> ninja vereign -v
```
The `vereign.dll` will be created inside `cmake-build-debug\bin\Debug` directory.
### C API Usage
For C/C++ users, the library has a single header file located in `include\vereign` directory.
The service is started with `vereign_service_start`. This will start a gRPC server in its own thread(s).
The call returns immediately.
After the service is started you can use your favorite language generated gRPC client to communicate
with the service.
Use the `vereign_service_selected_port` function to get the listen port of the gRPC server.
When you are finished with the service, for example upon shutdown of the application, one must use
the `vereign_service_shutdown` API. It will shutdown the service and free any acquired resources.
Afterwards the returned `vereign_service` pointer from the start call is invalid and must not be used anymore.
For more detailed info check the source code documentation in the header
[include/vereign/vereign.h](cpp/include/vereign/vereign.h).
You can also look at C++ usage example in the C API integration test
[tests/integration/integration_test.cc](cpp/tests/integration/integration_test.cc).
The gRPC APIs are located here [https://code.vereign.com/code/vcl-proto/-/tree/master/proto%2Fvereign%2Fclient_library](https://code.vereign.com/code/vcl-proto/-/tree/master/proto%2Fvereign%2Fclient_library).
FIXME: Add sample integration - for example for C#.
TODO: Add more documentation/reference; instructions to generate doxygen reference.