mirror of
https://github.com/PurpleI2P/pyseeder
synced 2025-01-30 00:24:33 +00:00
automatic cert file name during keygen
This commit is contained in:
parent
9de0809bad
commit
462bed826d
@ -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)
|
||||
|
||||
|
@ -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…
x
Reference in New Issue
Block a user