def get_group_info(num):
"""Returns UUID and path to the group AIK file for vtpm group `num`."""
# Get info for group `num`
ginfo = show_group(num)
uuid = ginfo['uuid']
aikname = '{0}_aik'.format(uuid)
pubaik_path = '{0}.pub'.format(aikname)
# Check that we have the group's AIK
if not os.path.exists(pubaik_path):
logger.error('Group %d AIK Path %r doesn\'t exist', num, pubaik_path)
raise OSError()
aikbase = '{0}'.format(aikname)
aikpem = aikbase + '.pem'
# Convert group AIK to PEM
check_call('tpmconv -ik {0} -ok {1}'.format(pubaik_path, aikbase),
shell=True)
return {'aikpem': aikpem, 'uuid': uuid}
评论列表
文章目录