Commit a4eed283 authored by Lucas Carvalho's avatar Lucas Carvalho

Renamed the parameters.

Renamed signature_public_file to signature_certificate_file, because the
name is cleaner once the content of the file is a X509 certificate
file. It is also known as Public Key Certificate.

Renamed signature_private_file to signature_private_key_file, because
the is is cleaner once the content of the file is a private RSA key.
parent 7bcff9e6
......@@ -19,7 +19,7 @@ import argparse
import sys
def createPrivateKeyAndCertificateFile(signature_public_file, signature_private_file, **kw):
def createPrivateKeyAndCertificateFile(signature_certificate_file, signature_private_key_file, **kw):
''' It must create a private key and a certificate file. '''
cur_time = M2Crypto.ASN1.ASN1_UTCTIME()
cur_time.set_time(int(time.time()) - 60*60*24)
......@@ -49,21 +49,21 @@ def createPrivateKeyAndCertificateFile(signature_public_file, signature_private_
cs_cert.sign(cs_pk, md="sha256")
# Saving...
cs_cert.save_pem(signature_public_file)
cs_rsa.save_pem(signature_private_file, None)
cs_cert.save_pem(signature_certificate_file)
cs_rsa.save_pem(signature_private_key_file, None)
return cs_cert.as_text()
def parseArgument(*args):
''' Parses command line arguments. '''
parser = argparse.ArgumentParser()
parser.add_argument('--signature-public-file',
parser.add_argument('--signature-certificate-file',
default='public.pem',
help='Signature public file.')
help='X509 Cetification file.')
parser.add_argument('--signature-private-file',
parser.add_argument('--signature-private-key-file',
default='private.pem',
help='Signature private file.')
help='Signature private key file.')
parser.add_argument('-c','--country',
default='XX',
......
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