parser.add_argument("--public-key-hash-c", dest='PublicKeyHashCFile', type=argparse.FileType('wb'), help="specify the public key hash filename that is SHA 256 hash of 2048 bit RSA public key in C structure format")\r
parser.add_argument("-v", "--verbose", dest='Verbose', action="store_true", help="increase output messages")\r
parser.add_argument("-q", "--quiet", dest='Quiet', action="store_true", help="reduce output messages")\r
- parser.add_argument("--debug", dest='Debug', type=int, metavar='[0-9]', choices=range(0,10), default=0, help="set debug level")\r
+ parser.add_argument("--debug", dest='Debug', type=int, metavar='[0-9]', choices=range(0, 10), default=0, help="set debug level")\r
\r
#\r
# Parse command line arguments\r
sys.exit(1)\r
\r
Version = Process.communicate()\r
- if Process.returncode <> 0:\r
+ if Process.returncode != 0:\r
print('ERROR: Open SSL command not available. Please verify PATH or set OPENSSL_PATH')\r
sys.exit(Process.returncode)\r
print(Version[0])\r
#\r
Process = subprocess.Popen('%s genrsa -out %s 2048' % (OpenSslCommand, Item.name), stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)\r
Process.communicate()\r
- if Process.returncode <> 0:\r
+ if Process.returncode != 0:\r
print('ERROR: RSA 2048 key generation failed')\r
sys.exit(Process.returncode)\r
\r
#\r
Process = subprocess.Popen('%s rsa -in %s -modulus -noout' % (OpenSslCommand, Item), stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)\r
PublicKeyHexString = Process.communicate()[0].split('=')[1].strip()\r
- if Process.returncode <> 0:\r
+ if Process.returncode != 0:\r
print('ERROR: Unable to extract public key from private key')\r
sys.exit(Process.returncode)\r
PublicKey = ''\r
Process = subprocess.Popen('%s dgst -sha256 -binary' % (OpenSslCommand), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)\r
Process.stdin.write (PublicKey)\r
PublicKeyHash = PublicKeyHash + Process.communicate()[0]\r
- if Process.returncode <> 0:\r
+ if Process.returncode != 0:\r
print('ERROR: Unable to extract SHA 256 hash of public key')\r
sys.exit(Process.returncode)\r
\r