Store application credentials in keyring with RSA.
Project description
Credentials Safe
Store application credentials in keyring with RSA.
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 this key otherwise you cannot get credentials
key = os.urandom(64)
credsafe_agent = Agent(app_name="my app", key_pair=kp, hmac_key=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.18.tar.gz
(3.5 kB
view hashes)
Built Distribution
credsafe-0.0.18-py3-none-any.whl
(16.2 kB
view hashes)
Close
Hashes for credsafe-0.0.18-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f84b727b4a899fb913bb4288514a92058fb4373a648f9c8ca86cbe8196cb097f |
|
MD5 | c4b85d4647f177c9a33d07b2c709289e |
|
BLAKE2b-256 | 1cf12c06346a349afecabdac4f0c26f494d40440e21c7b649ffd21a1d2d387f3 |