Commit 58ef73b0 authored by ale's avatar ale

add a --days option to the cli tool

parent 33ce6378
......@@ -33,6 +33,8 @@ def main():
'comma-separated ATTR=VALUE assignments')
parser.add_option('--secret', dest='secret',
help='shared secret for authentication')
parser.add_option('--days', dest='days', type='int', default=7,
help='certificate validity')
opts, args = parser.parse_args()
if len(args) < 1:
parser.error('No command specified')
......@@ -59,7 +61,7 @@ def main():
if not opts.subject:
parser.error('Must specify --subject')
subject = certutil.parse_subject(opts.subject)
pkey, cert = ca.make_certificate(subject, days=7,
pkey, cert = ca.make_certificate(subject, days=opts.days,
server=opts.server)
writeout(opts.output, crypto.dump_certificate(
crypto.FILETYPE_PEM, cert))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment