AWS Nitro安全模块(NSM)的本机Python接口

aws-nsm-interface的Python项目详细描述


原生Python中的AWS Nitro安全模块(NSM)接口

这个库为AWS Nitro Enclaves中的/dev/nsm设备提供了一个本机Python接口。在

安装

要安装aws_nsm_interface,请运行:

pip install aws_nsm_interface

要求

  • 安装:python>;=3.6
  • 运行:一个在AWS Nitro飞地中运行的Python应用程序

快速启动

^{pr2}$

公共方法

Python AWS NSM接口提供以下功能:

# open_nsm_device() returns a file object for /dev/nsmopen_nsm_device()->typing.TextIO# close_nsm_device() closes the file objectclose_nsm_device(file_handle:typing.TextIO)->None# All of the functions below raise an IoctlError in case of an exception.# Generate up to 256 random bytes with /dev/nsm. Returns the raw bytes.get_random(file_handle:typing.TextIO,length:int=32)->bytes# Example output: b'se\xb7\x05O<:\x07W\x8cfn'# Return an attestation doc generated by /dev/nsm. `user_data`, `nonce` and# `public_key` are all binary (bytes) and optional.get_attestation_doc(file_handle:typing.TextIO,user_data:bytes=None,nonce:bytes=None,public_key:bytes=None)->dict# Example output: {'document': b'\x84D\xa1\x018"\xa0Y ... # \xeb|\x1b\xf6\xb6\x95\xb4\x9c[+x\x8b'}# Describe the NSM and known PCRs.describe_nsm(file_handle:typing.TextIO)->dict# Example output: {'version_major': 1, 'version_minor': 0, 'version_patch': 0,# 'module_id': 'i-00c89f181802cdef4-enc0175cd0dcee36866', 'max_pcrs': 32,# 'locked_pcrs': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],# 'digest': 'SHA384'}# Extend a PCR at the given index. Raises an IoctlError if the PCR is locked.# Returns the new data for the PCR.extend_pcr(file_handle:typing.TextIO,index:int,data:bytes)->dict# Example output: {'data': b'\x9c\t\x15Rk\xb6(R~+mi\xabs ...# \xf6j\xf8\xbf\xa3*A\x19\xc0\x0cr\x15\xdf\x1b'}# Returns a dictionary with the lock status and PCR data for the PCR at the # given index (index 0 returns PCR0, and so on).describe_pcr(file_handle:typing.TextIO,index:int)->dict# Example output: {'lock': False, 'data': b'\x9c\t\x15Rk\xb6(R~ ...# \x15\xdf\x1b'}# lock_pcr() locks the PCR at the given index.lock_pcr(file_handle:typing.TextIO,index:int)->bool# lock_pcrs() locks the PCRs from 0 up to the given lock_range.# For example: a range of 5 will lock PCRs [0, 1, 2, 3, 4] - a range# of 5 starting at 0.lock_pcrs(file_handle:typing.TextIO,lock_range:int)->bool

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java需要64位jdk 1.5 for windows   eclipse运算符+对于参数类型java是未定义的。双,爪哇。双人   未下载文件扩展名为的java文件   java不支持带有POST的媒体类型   从动态创建的多个EditText读取文本时发生java错误   java无法为同一xpath单击多个按钮   如何在Java中动态格式化字符串   java Android Clear Middle活动   多线程Java内存模型volatile和x86   git在Java中通过Jgit忽略文件或文件夹   java“决策无法区分输入的备选方案1、2…”   子类的javajpa继承   java需要弄清楚如何操作mutator来弄清楚一个类,教授说,我对如何操作感到困惑   java如何使用JDBC将数据从文件复制到PostgreSQL?