Files
pycvc/tests/cvcert_to_hexstring.py
xoryouyou 02a4b5348c Pivoted AuthorizationBits dict.
Cleaned up the bits_test and added asserts
Also added utility to convert arbitrary files to hexstring
2023-09-11 21:52:06 +02:00

20 lines
440 B
Python

import binascii
import argparse
def file_to_hex(filename):
with open(filename, "rb") as f:
content = f.read()
print(binascii.hexlify(content))
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Helper util to convert CVCert(or any file) to hex string"
)
parser.add_argument("file", help="File to convert to hex")
args = parser.parse_args()
file_to_hex(args.file)