OSI-licensed open source

Open-Source Virtual HSM and Software Key Token Tools (2026)

A virtual or software HSM exposes the same PKCS#11 interface as a hardware security module but keeps keys in software. Developers use them to test code that will later run against real hardware, and sometimes for low-assurance production keys. They do not give you the tamper resistance of an actual HSM.

True open-source virtual HSMs are few, so this page is broadened to software PKCS#11 tokens, emulators and the glue that connects applications to them, plus OpenBao for service-based key operations. Everything here is open source with licences read from its repository on 2026-11-07.

Tools, licences and pricing checked against vendor and repository pages on November 7, 2026.

What to look for

  • •PKCS#11 conformance for the algorithms you use
  • •Backing store and how keys are protected at rest
  • •Integration with OpenSSL and other toolchains
  • •Maintenance and release activity
  • •Whether it is meant for testing or production

At a glance

ToolBest forPricingLicence
SoftHSM2Testing and development against a PKCS#11 interfaceFree, open sourceBSD-2-Clause
KryopticModern Rust-based software tokenFree, open sourceApache-2.0
openCryptokiLinux and AIX PKCS#11 deploymentsFree, open sourceCPL-1.0
swtpmVirtual TPMs for VMs and testsFree, open sourceBSD-3-Clause
OpenSCConnecting applications to smart cards and tokensFree, open sourceLGPL-2.1
pkcs11-providerUsing SoftHSM or hardware tokens from OpenSSL 3Free, open sourceApache-2.0
OpenBaoService-based key operationsFree, open sourceMPL-2.0

1. SoftHSM2

BSD-2-Clause

Best for: Testing and development against a PKCS#11 interface · Free, open source

SoftHSM is a software PKCS#11 cryptographic device that lets applications such as OpenDNSSEC manage keys without dedicated hardware.

Strengths

  • + The standard software PKCS#11 token
  • + Simple to set up

Trade-offs

  • − Software only, no tamper resistance

2. Kryoptic

Apache-2.0

Best for: Modern Rust-based software token · Free, open source

Kryoptic is a software-based PKCS#11 cryptographic token implemented in Rust.

Strengths

  • + Written in Rust
  • + Active repository

Trade-offs

  • − Newer than SoftHSM

3. openCryptoki

CPL-1.0

Best for: Linux and AIX PKCS#11 deployments · Free, open source

openCryptoki is a PKCS#11 library and toolset for Linux and AIX with tokens for IBM crypto hardware and a software token.

Strengths

  • + Software token plus hardware token support
  • + Long-running project

Trade-offs

  • − Licence is the older CPL-1.0

4. swtpm

BSD-3-Clause

Best for: Virtual TPMs for VMs and tests · Free, open source

swtpm is a libtpms-based TPM emulator with socket, character device and Linux CUSE interfaces, useful for virtualised TPM testing.

Strengths

  • + Emulates a TPM for VMs
  • + Multiple interfaces

Trade-offs

  • − A TPM emulator, not a PKCS#11 HSM

5. OpenSC

LGPL-2.1

Best for: Connecting applications to smart cards and tokens · Free, open source

OpenSC provides tools and middleware for smart cards, supporting PKCS#11 and MiniDriver interfaces.

Strengths

  • + PKCS#11 middleware
  • + Widely packaged

Trade-offs

  • − Smart-card focus rather than a virtual HSM

6. pkcs11-provider

Apache-2.0

Best for: Using SoftHSM or hardware tokens from OpenSSL 3 · Free, open source

A PKCS#11 provider for OpenSSL 3.0 and later, letting OpenSSL use PKCS#11 hardware and software tokens.

Strengths

  • + Bridges OpenSSL 3 to PKCS#11
  • + Works with software tokens

Trade-offs

  • − Needs a token behind it

7. OpenBao

MPL-2.0

Best for: Service-based key operations · Free, open source

OpenBao manages, stores and distributes secrets, certificates and keys as a service, an option when you want key operations over an API rather than PKCS#11.

Strengths

  • + API-driven key operations
  • + Active project

Trade-offs

  • − Not a PKCS#11 token

New tools in this space, weekly

One email a week with the tools, launches and releases added to TechLogHub. Unsubscribe in one click.

Get the TechLogHub digest

One email a week: new and trending developer tools, fresh comparisons, and what shipped. Unsubscribe in one click.

How to choose

If you need…Start with
PKCS#11 testing without hardwareSoftHSM2
Rust-based software tokenKryoptic
Linux and AIX PKCS#11 stackopenCryptoki
Virtual TPM for VMsswtpm
OpenSSL 3 integration with tokenspkcs11-provider
Smart-card middlewareOpenSC
Key operations over an APIOpenBao

Open-Source Virtual HSM and Software Key Token Tools: FAQ

Quick answers to common questions

What is a virtual HSM?

Software that mimics an HSM's interface, usually PKCS#11, while storing keys in software.

Is SoftHSM secure enough for production?

It is mainly for testing. Keys are protected by software, not tamper-resistant hardware.

Software HSM versus TPM emulator?

A software HSM provides PKCS#11 key operations; swtpm emulates a TPM chip for VMs.

Is there a complete open-source virtual HSM product?

Not as a single project; teams combine a software token such as SoftHSM2 with OpenSSL integration and a key service.

Related categories

Building a tool in this category?

List it on TechLogHub and we'll review it for this guide.

Submit a tool