Skip to main content
Applies to:
DuoKey PKCS#11 LibraryOracle TDEDuoKey Cockpit

The DuoKey PKCS#11 library is a software implementation of the PKCS#11 (Cryptoki) standard that connects Oracle Database TDE to the DuoKey Cockpit platform. It presents a standard Cryptoki surface to Oracle and, for each master-key operation, forwards the request over HTTPS to Cockpit, which performs the operation against the tenant keystore. The design is organized into clean layers that each own a specific responsibility.

Master-key path only

Oracle uses the library for the TDE master-key path only — opening the keystore, SET KEY, and wrapping / unwrapping the tablespace and table keys under the master key. Bulk tablespace data encryption stays local on the database host, hardware-accelerated by AES-NI. Only the small master-key operations cross the network.

High-Level Architecture​

Oracle Database issues standard PKCS#11 calls; the library forwards the master-key operations over HTTPS to DuoKey Cockpit, which performs them against the tenant keystore. In production this keystore is backed by a Securosys HSM; a DuoKey software keystore is used in development. Master-key material never leaves the platform.

Architecture

High-level architecture

Oracle TDE with the DuoKey PKCS#11 libraryThe PKCS#11 library on the database host reads pkcs11.toml and forwards master-key operations over HTTPS with a bearer token to DuoKey Cockpit, which uses the tenant keystore.DATABASE HOSTDUOKEY COCKPITPKCS#11BEARERREADORACLEOracle DatabaseTDE · bulk AES localDUOKEYPKCS#11 librarylibdke_pkcs11.sopkcs11.tomlURL · access_tokenCOCKPITDuoKey Cockpitmaster-key operationsKEYSTenant keystoreSecurosys HSM: prodsoftware: devLEGENDDuoKey CockpitOracleConfig / key custodyHTTPS + access_token bearerCall

The library on the database host reads pkcs11.toml and forwards master-key operations over HTTPS, with the access_token bearer credential, to Cockpit and its tenant keystore.

Layered by design

Each layer is independent and replaceable — Oracle compatibility, Cockpit communication, and key management are cleanly separated, so a change in one layer never ripples into the others.

Key Components​

Data Flow​

A typical open-keystore → provision master key → wrap tablespace key sequence flows through every layer, from Oracle down to the backend keystore and back. Note that only the master-key operations travel to Cockpit — the tablespace bulk data is encrypted locally under the (unwrapped) tablespace key.

Sequence

Initialize and provision the master key

Initialize and provision the master keyThe library initializes against Cockpit with its bearer credential, then Cockpit generates the AES-256 master key in the keystore and Oracle receives a handle to it.C_InitializeREAD PKCS11.TOMLBEARER HANDSHAKEREADYCKR_OKC_GenerateKey AES-256PROVISION MEKGENERATE KEYKEY REFERENCEKEY CREATEDMAP ID TO HANDLEKEY HANDLEORACLEOracle DatabaseTDEPROVIDERPKCS#11 librarylibdke_pkcs11.soCOCKPITDuoKey Cockpitv2 proxy endpointKEYSTOREKeystoreHSMLEGENDCallHTTPS requestReturnLocal stepHandle to Oracle

The library initializes against Cockpit with its bearer credential, then Cockpit generates the AES-256 master key in the keystore and Oracle receives a handle.

Sequence

Wrap a tablespace key

Wrap a tablespace keyOracle sends the tablespace key to be wrapped under the master key in the keystore; the bulk tablespace data itself is encrypted locally on the database host.C_EncryptWRAP · CBC-PADWRAP UNDER MEKWRAPPED KEYWRAPPED KEYWRAPPED KEYBULK AES LOCAL (AES-NI)ORACLEOracle DatabaseTDEPROVIDERPKCS#11 librarylibdke_pkcs11.soCOCKPITDuoKey Cockpitv2 proxy endpointKEYSTOREKeystoreHSMLEGENDCallHTTPS requestReturnLocal stepWrapped key to Oracle

Only the master-key operations travel to Cockpit; tablespace bulk data is encrypted locally under the unwrapped tablespace key.

Benefits of This Architecture​

Separation of Concerns

Each layer owns one responsibility: the PKCS#11 layer handles Oracle compatibility, the SDK layer handles Cockpit communication, and Cockpit handles key management.

Scalability

Supports multiple concurrent Oracle sessions, multiple database instances, and high-throughput operations — bulk data crypto stays local, so only master-key calls cross the network.

Security

Master-key material never leaves the keystore, transport is TLS-encrypted, access is bearer-token authenticated, and every operation is audit-logged in the Cockpit.

Flexibility

A Securosys HSM or DuoKey software keystore behind the same interface, simple file-plus-env configuration, and container-based deployment.

Keys stay in the platform

Across every layer, the TDE master key is generated, stored, and used inside the DuoKey Cockpit keystore (a Securosys HSM in production). The library only ever exchanges object handles and wrapped keys — never raw master-key material.

Next Steps​