Pular para o conteúdo principal

PKI Express Configuration

You can manage the following settings:

The configuration of PKI Express is managed with the command pkie config. To learn more about this command, read on. The client libraries have settings of their own, such as the folder where PKI Express is installed: see Client library settings.

Command pkie config​

To view the command syntax:

pkie help config

To view the current configuration:

pkie config

To set a configuration:

pkie config --set name=value

For instance:

pkie config --set logLevel=3

Effective configuration​

PKI Express may ignore a configuration value because it is invalid. For instance, if you set the tempDir configuration to an invalid path or to a directory which is not writeable, PKI Express will use the temporary directory from the TEMP environment variable instead. This is called the effective value of a configuration, that is, the configuration that PKI Express is actually using, which might differ from the configuration that was set manually.

When trying to diagnose configuration problems, it may be useful to view the effective configuration of PKI Express:

pkie config --effective

Client library settings​

The settings above belong to PKI Express and apply to every application on the machine. The client libraries have settings of their own, in the class PkiExpressConfig, which you pass to the constructor of each operation class (PadesSignatureStarter, SignatureFinisher, PadesSigner and so on). Without it, the class uses the defaults below.

SettingDefault
PKI Express folderWindows: the folder Lacuna Software\PKI Express that contains pkie.exe, under Program Files, Program Files (x86) or the user's %LOCALAPPDATA%. Linux: the pkie command on the PATH, where the setup pages place it
Temporary folderThe system temporary folder (Ruby: a new folder that the library creates in it). It holds the temporary files that the library writes for each operation
Transfer data folderThe temporary folder. It holds the transfer data files, which carry a signature from the start step to the finish step, so it must be the same in both steps

All three are constructor arguments, in this order, and each one can be left empty (null, None or nil):

LanguageExample
Javanew PadesSignatureStarter(new PkiExpressConfig("D:\\pkie", null, "D:\\pkie-transfer")) (String or Path arguments)
Node.jsnew PadesSignatureStarter(new PkiExpressConfig('D:\\pkie', null, 'D:\\pkie-transfer'))
PHPnew PadesSignatureStarter(new PkiExpressConfig('D:\\pkie', null, 'D:\\pkie-transfer'))
PythonPadesSignatureStarter(PkiExpressConfig('D:\\pkie', None, 'D:\\pkie-transfer'))
RubyPkiExpress::PadesSignatureStarter.new(PkiExpress::PkiExpressConfig.new('D:\\pkie', nil, 'D:\\pkie-transfer'))

If PKI Express is not in the folder you set or, on Windows, in any of the default folders, the library throws InstallationNotFoundException (Java, PHP) or InstallationNotFoundError (Node.js, Python, Ruby). If the temporary or transfer data folder you pass does not exist, the Java, Node.js, PHP and Python libraries fall back to the default without an error, while Ruby raises ArgumentError.

Custom folder on Linux

When you set the PKI Express folder on Linux, the Node.js, PHP, Python and Ruby libraries run dotnet <folder>/pkie.dll. Since version 1.31.0, the Linux package of PKI Express is a single pkie executable, with no pkie.dll (changelog), so with these libraries leave the folder empty and put pkie on the PATH. The Java library runs <folder>/pkie when the folder has no pkie.dll.

To delete the temporary files of an operation, call dispose() (Java) or disposeSync() (Node.js) after the operation completes, as the Java signature sample does; the PHP, Python and Ruby libraries delete them when the object is destroyed or garbage-collected. Transfer data files are not temporary files: the finish step needs them.

View as Markdown