Fix config parsing for pkcs11 module

This commit is contained in:
Timotej Lazar 2026-03-11 10:50:47 +01:00
parent c812e52bad
commit b34bee54a3

View file

@ -44,7 +44,7 @@ def init(args):
if not args.id:
raise Exception('key ID not specified')
if not args.module:
args.module = config.get(args.module, 'module')
args.module = config.get(args.url, 'module', fallback=None)
args.module = ["--module", str(pathlib.Path(args.module))] if args.module else []
args.cert = base64.b64encode(subprocess.run(['pkcs11-tool'] + args.module + ['--read-object', '--type', 'cert', '--id', args.id], capture_output=True).stdout).decode()