From 1872ea54d8801992a5537b0a280ff60023976db0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mois=C3=A9s=20Guimar=C3=A3es=20de=20Medeiros?= Date: Tue, 9 Oct 2018 16:20:31 +0200 Subject: [PATCH] Add 'barbican-manage hsm check_[mkek|hmac]. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New command to check if a label exists, so that a script that generate the keys can use it to determine wheteher gen_mkek/gejn_hmac needs to be called or not. Change-Id: I6eb0d138fe3d3f322d94e47d21ec6ec58469995e Signed-off-by: Moisés Guimarães de Medeiros --- barbican/cmd/barbican_manage.py | 51 +++++++++++++++++-- barbican/tests/cmd/test_barbican_manage.py | 20 ++++++++ ...ge-check-subcommands-38835078f5cc0ce2.yaml | 7 +++ 3 files changed, 74 insertions(+), 4 deletions(-) create mode 100644 releasenotes/notes/add-barbican-manage-check-subcommands-38835078f5cc0ce2.yaml diff --git a/barbican/cmd/barbican_manage.py b/barbican/cmd/barbican_manage.py index 520c570e9..d1572c997 100644 --- a/barbican/cmd/barbican_manage.py +++ b/barbican/cmd/barbican_manage.py @@ -172,6 +172,27 @@ class HSMCommands(object): description = "Subcommands for managing HSM/PKCS11" + check_mkek_description = "Checks if a MKEK label is available" + + @args('--library-path', metavar='', dest='libpath', + default='/usr/lib/libCryptoki2_64.so', + help='Path to vendor PKCS11 library') + @args('--slot-id', metavar='', dest='slotid', default=1, + help='HSM Slot id (Should correspond to a configured PKCS11 slot, \ + default is 1)') + @args('--passphrase', metavar='', default=None, required=True, + help='Password to login to PKCS11 session') + @args('--label', '-L', metavar='