Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ai
autoca
Commits
58ef73b0
Commit
58ef73b0
authored
Jan 15, 2012
by
ale
Browse files
add a --days option to the cli tool
parent
33ce6378
Changes
1
Hide whitespace changes
Inline
Side-by-side
autoca/ca_tool.py
View file @
58ef73b0
...
...
@@ -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
))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment