INNER CODE UNIT · Python
get_label_by_id
tpm2-software/tpm2-pkcs11 · tools/tpm2_pkcs11/commandlets_keys.py:397
def get_label_by_id(tobj, keyid):
attrs = yaml.safe_load(io.StringIO(tobj['attrs']))
if CKA_ID in attrs:
x = attrs[CKA_ID]
if x == keyid and attrs[CKA_CLASS] == CKO_PRIVATE_KEY:
return attrs[CKA_LABEL] if CKA_LABEL in attrs else ''
return None
@commandlet("objmod")
class ObjMod(Command):
'''
Dumps and modifies objects.
'''
_type_map = {