vtpm_manager.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:python-keylime 作者: mit-ll 项目源码 文件源码
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}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号