Pyeleven
python PKCS11 REST proxy
Install / Use
/learn @IdentityPython/PyelevenREADME
Python PKCS11 REST Proxy
A flask REST proxy for talking to a PKCS11 token wo having access to a native pkcs11 shim layer. Useful for cripled languages.
Getting started
- build a virtualenv
- install gunicorn
- install this application
- create config for your token
Checkout code
# git clone <this github url>
Build a virtualenv
# apt-get install python-virtualenv
# virtualenv /path/to/venv
# . /path/to/venv/bin/activate
Install packages
# pip install -r requirements.txt
# pip install gunicorn
Install this application
# ./setup develop
Create config
In the examples directory there is a script (gen-token.sh) that builds a sample config based on softhsm. Install softhsm first, then run gen-token.sh to create token, generate keys and create config.py. Finally start pyeleven in the same directory as the config.py file:
# apt-get install libhsm-bin
# cd examples
# make
# ls
config.py gen-token.sh Makefile openssl.conf softhsm.conf softhsm.db test.crt test.der
# env SOFTHSM_CONF=softhsm.conf gunicorn --log-level debug -b :8080 pyeleven:app
This should start pyeleven on port 8080. Now try to sign something by POSTing a JSON object with 'mech' and 'data' fields. Currently 'mech' is silently ignored and RSASHA1 is used for everything. This will change soon.
API
Sign
POST a JSON object to
/<slot>/<keyalias>/sign
with the following pattern:
{'mech': 'RSAPKCS1', 'data': base64(<to be signed>)}
if successful the response will be a JSON object:
{'mech': 'RSAPKCS1', 'slot': <slot>, 'signed': base64(<signed bytes>)}
Slot Info
GET /<slot>
returns a JSON datastructure representing information.
Related Skills
node-connect
350.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
350.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
350.8kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。


