INNER CODE UNIT · Python
get_default_store_path
tpm2-software/tpm2-pkcs11 · tools/tpm2_pkcs11/command.py:10
def get_default_store_path():
# always use the env variable no matter what
if "TPM2_PKCS11_STORE" in os.environ:
store = os.environ.get("TPM2_PKCS11_STORE")
try:
os.mkdir(store, 0o770)
except FileExistsError:
return store
except Exception:
# Keep trying
pass
# Exists, use it
return store
# is there a system store and can I access it?
store = "/etc/tpm2_pkcs11"
if os.path.exists(store) and os.access(store, os.W_OK):