1{ lib, stdenv, fetchurl, botan2, libobjc, Security }:
2
3stdenv.mkDerivation rec {
4
5 pname = "softhsm";
6 version = "2.6.1";
7
8 src = fetchurl {
9 url = "https://dist.opendnssec.org/source/${pname}-${version}.tar.gz";
10 hash = "sha256-YSSUcwVLzRgRUZ75qYmogKe9zDbTF8nCVFf8YU30dfI=";
11 };
12
13 configureFlags = [
14 "--with-crypto-backend=botan"
15 "--with-botan=${lib.getDev botan2}"
16 "--sysconfdir=$out/etc"
17 "--localstatedir=$out/var"
18 ];
19
20 propagatedBuildInputs =
21 lib.optionals stdenv.isDarwin [ libobjc Security ];
22
23 buildInputs = [ botan2 ];
24
25 postInstall = "rm -rf $out/var";
26
27 meta = with lib; {
28 homepage = "https://www.opendnssec.org/softhsm";
29 description = "Cryptographic store accessible through a PKCS #11 interface";
30 longDescription = "
31 SoftHSM provides a software implementation of a generic
32 cryptographic device with a PKCS#11 interface, which is of
33 course especially useful in environments where a dedicated hardware
34 implementation of such a device - for instance a Hardware
35 Security Module (HSM) or smartcard - is not available.
36
37 SoftHSM follows the OASIS PKCS#11 standard, meaning it should be
38 able to work with many cryptographic products. SoftHSM is a
39 programme of The Commons Conservancy.
40 ";
41 license = licenses.bsd2;
42 maintainers = [ maintainers.leenaars ];
43 platforms = platforms.unix;
44 };
45}