Browse Source

automatic cert file name during keygen

pull/3/head
l-n-s 8 years ago
parent
commit
462bed826d
  1. 2
      pyseeder.py
  2. 3
      pyseeder/actions.py

2
pyseeder.py

@ -23,7 +23,7 @@ def main(): @@ -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)

3
pyseeder/actions.py

@ -5,6 +5,9 @@ from pyseeder.utils import PyseederException, check_readable, check_writable @@ -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

Loading…
Cancel
Save