1
0
mirror of https://github.com/PurpleI2P/pyseeder synced 2025-01-30 16:44:16 +00:00

automatic cert file name during keygen

This commit is contained in:
l-n-s 2016-11-03 12:21:35 -04:00
parent 9de0809bad
commit 462bed826d
2 changed files with 4 additions and 1 deletions

View File

@ -23,7 +23,7 @@ def main():
help="Identifier of certificate (example: user@mail.i2p)")
kg_parser.add_argument("--private-key", default="data/priv_key.pem",
help="RSA private key (default: data/priv_key.pem)")
kg_parser.add_argument("--cert", required=True,
kg_parser.add_argument("--cert", default=None,
help="Certificate (example: data/user_at_mail.i2p.crt)")
kg_parser.set_defaults(func=pyseeder.actions.keygen)

View File

@ -5,6 +5,9 @@ from pyseeder.utils import PyseederException, check_readable, check_writable
def keygen(args):
"""Sub-command to generate keys"""
if not args.cert:
args.cert = "data/{}.crt".format(args.signer_id.replace("@", "_at_"))
for f in [args.cert, args.private_key]: check_writable(f)
from pyseeder.crypto import keygen