Store application credentials in keyring with RSA and AES.
Project description
Credentials Safe
Store application credentials in keyring with RSA and AES.
Hierarchy
credsafe
'---- Agent()
|---- set()
|---- get()
'---- rm()
Example
python
from credsafe import *
# initialize an agent
kp = { # check easyrsa for more info
"private_key": b"...",
"public_key": b"..."
}
import os
# remember these keys otherwise you cannot get credentials
aes_key = os.urandom(64)
hmac_key = os.urandom(64)
credsafe_agent = Agent(app_name="my app", key_pair=kp, aes_key=aes_key, hmac_key=hmac_key)
# set something for a user
credsafe_agent.set(id="username", pw="password", k="phone", v=123456789)
credsafe_agent.set(id="username", pw="password", k="config", v={"something": "secret"})
# get something for a user
print(credsafe_agent.get(id="username", pw="password", k="phone"))
# 123456789
print(credsafe_agent.get(id="username", pw="password", k="config"))
# {"something": "secret"}
# remove something for a user
credsafe_agent.rm(id="username", pw="password", k="config")
print(credsafe_agent.get(id="username", pw="password", k="config"))
# KeyError
shell
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
credsafe-0.0.22.tar.gz
(3.6 kB
view hashes)
Built Distribution
credsafe-0.0.22-py3-none-any.whl
(16.3 kB
view hashes)
Close
Hashes for credsafe-0.0.22-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7802109cce00a5faeb8212e2e45fdcad061c69cf578cc8978a879be2c1e9c1a7 |
|
MD5 | 412a2db8f9a7638e3529a57b9301cb48 |
|
BLAKE2b-256 | 9cb723c1f6f1d9d8f2d7692818097c707d1fd6ddff8522773b2ea5bcf9099af7 |