Native Python interface for the AWS Nitro Secure Module (NSM)
Project description
AWS Nitro Secure Module (NSM) interface in native Python
This library offers a native Python interface to the /dev/nsm
device in AWS Nitro Enclaves. This is an updated version from aws-nsm-interface.
Installation
To install aws_nsm_interface
, run:
pip install aws_nsm_interface
Requirements
- To install: python>=3.6
- To run: a Python application running in an AWS Nitro Enclave
Quickstart
import base64
import aws_nsm_interface
file_desc = aws_nsm_interface.open_nsm_device()
rand_bytes = aws_nsm_interface.get_random(file_desc, 12) # Get 12 random bytes from /dev/nsm
print(rand_bytes)
public_rsa_key = b'1234' # An RSA public key exported as DER
attestation_doc = aws_nsm_interface.get_attestation_doc(
file_desc,
public_key=public_rsa_key
)['document']
attestation_doc_b64 = base64.b64encode(attestation_doc).decode('utf-8')
aws_nsm_interface.close_nsm_device(file_desc)
# Use `attestation_doc_b64` in your AWS KMS Decrypt call
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for aws-nsm-interface-verifiably-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d4025df66825b5cfee5255e491bbd762aadb5ebecc5e23192a99aa31a1aa69d |
|
MD5 | ff8c9af16161ad4b017fa1bac6f3c8ed |
|
BLAKE2b-256 | c68b6e83f4350ead2039744d3924c0d05193b5fde2054a0b87e337626b550a67 |
Close
Hashes for aws_nsm_interface_verifiably-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 672db4fd491c3d82e6fe2cd88d9f85a69fafaf63f4b7cd902a451c709226d78b |
|
MD5 | 15378b921ce1bbbd8c11de8f417f0e9d |
|
BLAKE2b-256 | 03d93351aff9d39a903a2b2364cf22ffca400b04bb66e1a30a099076cb736152 |