Skip to content

Latest commit

 

History

History
86 lines (67 loc) · 1.73 KB

BuildPkcs11Lib.md

File metadata and controls

86 lines (67 loc) · 1.73 KB

Building PKCS#11 library

Due to the mutual incompatibility of some Linux distributions, it will be necessary to make a separate build BouncyHsm.Pkcs11Lib.

Prerequisites

  • clang compiler or gcc
  • make
  • git

The compiled library is named BouncyHsm.Pkcs11Lib-x64.so.

Makefile parameters

To facilitate building for other platforms, it is possible to parameterize the makefile:

  • CC - for compiler, default is clang,
  • ARCH_FLAGS - for architecture, default is -m64,
  • EXTRA_FLAGS - for extra compilation flags.

Example build command for ARM with gcc:

make CC=gcc ARCH_FLAGS="-march=armv8-a"

Example compilation for Alpine Linux

Install prerequisites:

apk add build-base
apk add git

Clone repository:

git clone https://github.com/harrison314/BouncyHsm.git

Build:

cd BouncyHsm
# git checkout <last tag>
cd build_linux
make CC=gcc

Example compilation for Rocky Linux 9/AlmaLinux OS 9

The native library for AlmaLinux 9 (RHEL like distributions) is already connected to BouncyHsm, the following procedure serves as a demonstration.

Install prerequisites:

dnf install make gcc clang git -y

Clone repository:

git clone https://github.com/harrison314/BouncyHsm.git

Build:

cd BouncyHsm
# git checkout <last tag>
cd build_linux
make

The compiled library is named BouncyHsm.Pkcs11Lib-x64.so.

Example compilation for Raspberry Pi OS

Install prerequisites:

sudo apt-get install make gcc git -y

Clone repository:

git clone https://github.com/harrison314/BouncyHsm.git

Build:

cd BouncyHsm
# git checkout <last tag>
cd build_linux
make CC=gcc ARCH_FLAGS=""