INNER CODE UNIT · Python
new_key_init
tpm2-software/tpm2-pkcs11 · tools/tpm2_pkcs11/commandlets_keys.py:70
def new_key_init(self, label, sopin, userpin, hierarchyauth, pobj, sealobjects, tpm2, d):
pobj_handle = get_pobject(pobj, tpm2, hierarchyauth, d)
# Get the primary object encrypted auth value and sokey information
# to decode it. Based on the incoming pin
is_so = sopin != None
pin = sopin if is_so else userpin
pubkey = '%spub' % ('so' if is_so else 'user')
privkey = '%spriv' % ('so' if is_so else 'user')
saltkey = '%sauthsalt' % ('so' if is_so else 'user')
sealpub = sealobjects[pubkey]
sealpriv = sealobjects[privkey]
sealsalt = sealobjects[saltkey]
sealctx = tpm2.load(pobj_handle, pobj['objauth'], sealpriv, sealpub)