Library Configuration - niclabs/dtc GitHub Wiki
The configuration file is named config.yaml and it can be in the current working directory or in /etc/dtc/ folder.
The structure is the following:
dtc:
logfile: /tmp/dtc.log
general:
dtc:
messagingtype: zmq
nodesnumber: 5
threshold: 3
criptoki:
manufacturerid: NICLabs
model: dHSM RSA
description: Distributed HSM using RSA signatures
serialnumber: "1"
minpinlength: 3
maxpinlength: 10
maxsessioncount: 5
databasetype: sqlite3
slots:
- label: TCBHSM
pin: "1234"
sqlite3:
path: db.sqlite3
zmq:
timeout: 10
publickey: ...
privatekey: ...
nodes:
- publickey: ...
host: 172.17.1.11
port: 2030
- publickey: ...
host: 172.17.1.12
port: 2030
- publickey: ...
host: 172.17.1.13
port: 2030
- publickey: ...
host: 172.17.1.14
port: 2030
- publickey: ...
host: 172.17.1.15
port: 2030
The complete config tree is under a dtc key. It has a mandatory section, called general, where we currently define three variables:
logfileis the absolute path where the log is going to be saved. If empty or undefined, the log will be printed on the stderr of the program which is using the library.dtcrepresents the specific configuration used by the server. It defines amessagingType(Currently, only ZMQ), anodesNumbervalue (the total number of nodes that are going to participate in the protocol) and athresholdnumber (the minimum number of nodes that need to sign a document to declare it as signed correctly.criptokidefines the following Criptoki/PKCS#11 specific variables:
manufacturerIdis the ID of the manufacturer of the HSM.modelis the model of the HSM.descriptionis a brief description of the HSM.serialNumberis the serial number of the HSM.minPinLenis the minimum length for the PINs.maxPinLenis the maximum length for the PINs.maxSessionCountis the maximum number of simultaneous sessions.databaseTypeis the type of the storage for the HSM. Currently the only value available issqlite3.slotsdefines the slots available on the HSM. Each slot has alabelfield, representing the slot name, and aPINfield, used in token creation only. the HSM creates by default the slots defined here.
Also, there are two extra configurations outside general option:
- Network Configurations: They define the options for the network driver. Currently,
zmqis the only available, but the implementation allows to extend it to other messaging systems.zmqdefines the following options: timeoutrepresents the maximum time a node should be waited to declare it as non responsive.publicKeyrepresents a Base85 public key used by ZMQ CURVE Auth mode. The nodes should communicate in this mode to send and receive encripted messages.privateKeyrepresents a Base85 public key used by ZMQ CURVE Auth mode. The nodes should communicate in this mode to send and receive encripted messages.nodesis a list of dictionaries with node information. This list must be of the same size as thenodesNumbervariable ingeneral.dtc. Each node is represented byhost,portandpublicKeyparameters (IP/Port/Public Key of the node).- Storage Configurations: They define the options for the storage driver. Currently,
sqlite3is the only available, but the implementation allows to extend it to other storage systems.sqlite3defines the following options: pathis the path to the sqlite3 database.
If you need to generate a public/private Base85 key pair for ZMQ Curve Authentication, we recommend to use the gencurve
utility in dtcconfig repository.