keyutils bindings for Python
Project description
turkeyutils is a set of python bindings for keyutils (available from http://people.redhat.com/~dhowells/keyutils), a key management suite that leverages the infrastructure provided by the Linux kernel for safely storing and retrieving sensitive infromation in your programs.
Usage
The C extension module follows closely the C API (see add_key(2), request_key(2), keyctl_read_alloc(2)).
Exceptions also follow the C API. The only notable difference is for request_key: when the key is not present, None is returned, instead of raising an exception (which is usually a more expensive operation).
Note that the function parameters are passed as bytes not strings! On python 3 this usually requires an explicit param.encode() call.
For example:
import keyutils
# NOTE: only pass `bytes` to the keyutils API:
name = b'foo'
value = b'bar'
ring = keyutils.KEY_SPEC_PROCESS_KEYRING
key_id = keyutils.add_key(name, value, ring)
assert keyutils.request_key(name, ring) == key_id
assert keyutils.read_key(key_id) == value
# set timeout to 5 seconds, wait and then... it's gone:
keyutils.set_timeout(key_id, 5)
from time import sleep
sleep(6)
assert keyutils.request_key(name, ring) == None
Further examples can be found in the test subfolder.
History
This project was part of the Conary/rpath project at SAS that is no longer supported or maintained. This project is a fork maintained by me!
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 Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file turkeyutils-0.6.1.tar.gz.
File metadata
- Download URL: turkeyutils-0.6.1.tar.gz
- Upload date:
- Size: 70.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
473fad9eb2412d5c5863192006cb32823f98a52d96921b30162ebae76853030b
|
|
| MD5 |
bc9b798522d37154bad595340ccdfd03
|
|
| BLAKE2b-256 |
082805e5c8d003107e5d1f701b0805970b9355b97eb15cbda443a6ae3a2157dd
|
File details
Details for the file turkeyutils-0.6.1-cp311-cp311-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: turkeyutils-0.6.1-cp311-cp311-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 269.2 kB
- Tags: CPython 3.11, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07d36e08f396a443774a08a60957219ba6b6bdb2e4c56055ee727bd636c1201d
|
|
| MD5 |
a3aab2789e9394341f94dd66cb04dd1b
|
|
| BLAKE2b-256 |
c0e99b155a9bc38ddf4812cc5c484cae010a6b27be49c5763936d5b666520954
|
File details
Details for the file turkeyutils-0.6.1-cp310-cp310-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: turkeyutils-0.6.1-cp310-cp310-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 238.1 kB
- Tags: CPython 3.10, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4393bb89825139f3c10313b10416bef31cf044a42807c0bc4f0738e544958e66
|
|
| MD5 |
fe2767a1c0f8a4ca39a6b06e809e3004
|
|
| BLAKE2b-256 |
7e861206d44a1dd36004f8405297c39537cbd6ba22fec07c67b85589e18ace62
|
File details
Details for the file turkeyutils-0.6.1-cp39-cp39-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: turkeyutils-0.6.1-cp39-cp39-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 237.9 kB
- Tags: CPython 3.9, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6efd7f195cb3b0e00e8db13eca94d6cd6493713a5d95b9fc8b63a3b95e05a2a4
|
|
| MD5 |
b3f474779e180e31d74cdbbb7c5aeaf2
|
|
| BLAKE2b-256 |
357818b8ab8b59e3b464927da514a4fd4335ada4797dc4413785406152975487
|
File details
Details for the file turkeyutils-0.6.1-cp38-cp38-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: turkeyutils-0.6.1-cp38-cp38-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 236.2 kB
- Tags: CPython 3.8, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74cbf7327d397972f5336ffe498bf468709261aad3122062a1d0d03e0b5749bb
|
|
| MD5 |
59433b286b13354009664c2665bde3e6
|
|
| BLAKE2b-256 |
836231b9a55522daf78cd8ddca27f2ab077e142cd7621d2005159e519274ecfb
|