PrivMX Endpoint
Programming library used by applications and devices which are the ends of PrivMX secure communication channels. It encrypts and decrypts data, manages network connections and provides a functional API, allowing the applications to build their E2EE communication channels based on a few universal, client-side encrypted tools: Threads, Stores, and Inboxes.
PrivMX Endpoint is a modular, low-level library written in C++, ready to be configured and used on any device (including IoT, VR + more) and any operating system.
Initialization of the application’s Endpoint requires providing an address of the application’s Bridge and the user's private key.
Architecture
Types of architecture included:
- for Linux:
- x86_64
- arm
- arm64
- for MacOS:
- macos64 - x86_64
- macos64 - arm64
- ios64 - arm64
- arm64simulator
- for Windows:
- x86_64
- for Android:
- arm (armeabi-v7a)
- arm64 (arm64-v8a)
- x86 (i386)
- x86_64
How to start
Install and configure Conan
To use PrivMX Endpoint you need to add it to your project using Conan Repository Manager. How to install Conan.
Setup Conan with our repository
conan profile detect --force
conan remote add privmx https://libs.simplito.com/artifactory/api/conan/privmx
Adding to a project - sample C++ program (CMake)
After installing Conan - create a Conan config file in the root dir of your project:
conanfile.txt
[requires]
privmx-endpoint/2.1.3
[generators]
CMakeDeps
CMakeToolchain
[layout]
cmake_layout
Next, add privmx-endpoint library dependency to your CMakeLists.txt:
CMakeLists.txt
cmake_minimum_required(VERSION 3.15)
project(test_program)
set(CMAKE_CXX_STANDARD 17)
find_package(privmxendpoint REQUIRED)
add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp)
target_link_libraries(test_program PUBLIC
privmxendpoint::privmxendpointcore
privmxendpoint::privmxendpointthread
privmxendpoint::crypto
)
main.cpp
#include <optional>
#include <iostream>
#include <privmx/endpoint/crypto/CryptoApi.hpp>
using namespace privmx::endpoint::crypto;
int main() {
auto cryptoApi {CryptoApi::create()};
auto priv = cryptoApi.generatePrivateKey(std::nullopt);
auto pub = cryptoApi.derivePublicKey(priv);
std::cout << "Generated private key: " << priv << std::endl
<< "Generated public key: " << pub << std::endl;
return 0;
}
Build project
conan install . --output-folder=build --build=missing
cd build
cmake .. -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=build/Release/generators/conan_toolchain.cmake \
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=Release
cmake --build .