aboutsummaryrefslogtreecommitdiffstats
path: root/lang/python/examples/howto/temp-homedir-config.py
diff options
context:
space:
mode:
authorBen McGinnes <[email protected]>2018-03-28 23:27:41 +0000
committerBen McGinnes <[email protected]>2018-03-28 23:27:41 +0000
commit75a1a1c33efe952986bba56494b81e2f4835b8c4 (patch)
tree579dc8e4920d3f989f6d1400269466e7e15c4fab /lang/python/examples/howto/temp-homedir-config.py
parentjson: Remove the "message" object thingy again. (diff)
parentexample: revoke UID (diff)
downloadgpgme-75a1a1c33efe952986bba56494b81e2f4835b8c4.tar.gz
gpgme-75a1a1c33efe952986bba56494b81e2f4835b8c4.zip
Merge branch 'ben/howto-update-02' of ssh+git://playfair.gnupg.org/git/gpgme
Diffstat (limited to 'lang/python/examples/howto/temp-homedir-config.py')
-rwxr-xr-xlang/python/examples/howto/temp-homedir-config.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/lang/python/examples/howto/temp-homedir-config.py b/lang/python/examples/howto/temp-homedir-config.py
index 368cace1..ddd79327 100755
--- a/lang/python/examples/howto/temp-homedir-config.py
+++ b/lang/python/examples/howto/temp-homedir-config.py
@@ -69,6 +69,10 @@ personal-digest-preferences SHA512 SHA384 SHA256 SHA224 RIPEMD160 SHA1
personal-compress-preferences ZLIB BZIP2 ZIP Uncompressed
"""
+agentconf = """# gpg-agent.conf settings for key generation:
+default-cache-ttl 300
+"""
+
if len(sys.argv) == 1:
print(intro)
new_homedir = input("Enter the temporary gnupg homedir name: ")
@@ -107,9 +111,12 @@ else:
print("Creating the {0} directory.".format(nh))
os.mkdir(nh)
os.chmod(nh, 0o700)
- with open("{0}/{1}".format(nh, "gpg.conf"), "w") as f:
- f.write(gpgconf)
+ with open("{0}/{1}".format(nh, "gpg.conf"), "w") as f1:
+ f1.write(gpgconf)
os.chmod("{0}/{1}".format(nh, "gpg.conf"), 0o600)
+ with open("{0}/{1}".format(nh, "gpg-agent.conf"), "w") as f2:
+ f2.write(gpgconf)
+ os.chmod("{0}/{1}".format(nh, "gpg-agent.conf"), 0o600)
print("""You may now use the {0} directory as an alternative GPG homedir:
gpg --homedir {0}