Skip to content

Commit

Permalink
minor py3 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jettero committed Mar 12, 2020
1 parent 685787b commit 817adf3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions contrib/gen-pretend-certs.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ def gen_CA(fname='ca-root', cn='ca-root', path_length=0, authority=None, pdir=DE
public_key = private_key.public_key()

with open(os.path.join(pdir, fname + '.key'), 'w') as fh:
fh.write( as_pem(private_key) )
fh.write( str(as_pem(private_key)) )

with open(os.path.join(pdir, fname + '.unsigned'), 'w') as fh:
fh.write( as_pem(public_key) )
fh.write( str(as_pem(public_key)) )

ksec_100 = datetime.timedelta(0, 100e3, 0)
Msec_300 = datetime.timedelta(0, 300e6, 0)
Expand Down Expand Up @@ -115,7 +115,7 @@ def gen_CA(fname='ca-root', cn='ca-root', path_length=0, authority=None, pdir=DE
certificate = builder.sign(**signing_args)

with open(os.path.join(pdir, fname + '.crt'), 'w') as fh:
fh.write( as_pem(certificate) )
fh.write( str(as_pem(certificate)) )

return Authority(private_key, certificate)

Expand All @@ -127,10 +127,10 @@ def gen_leaf(authority, fname_template='{}', cn='Certy Cert McCertFace', pdir=DE
public_name = fname_template.format('public')

with open(os.path.join(pdir, private_name + '.key'), 'w') as fh:
fh.write( as_pem(private_key) )
fh.write( str(as_pem(private_key)) )

with open(os.path.join(pdir, public_name + '.unsigned'), 'w') as fh:
fh.write( as_pem(public_key) )
fh.write( str(as_pem(public_key)) )

ksec_100 = datetime.timedelta(0, 100e3, 0)
Msec_300 = datetime.timedelta(0, 300e6, 0)
Expand Down Expand Up @@ -187,7 +187,7 @@ def gen_leaf(authority, fname_template='{}', cn='Certy Cert McCertFace', pdir=DE
certificate = builder.sign(**signing_args)

with open(os.path.join(pdir, public_name + '.crt'), 'w') as fh:
fh.write( as_pem(certificate) )
fh.write( str(as_pem(certificate)) )

return Authority(private_key, certificate)

Expand Down

0 comments on commit 817adf3

Please sign in to comment.