diff --git a/tools/rpi-bootloader-key-convert b/tools/rpi-bootloader-key-convert new file mode 100755 index 0000000..e95e652 --- /dev/null +++ b/tools/rpi-bootloader-key-convert @@ -0,0 +1,49 @@ +#!/usr/bin/env python3 + +import argparse +import struct +import sys + +from Cryptodome.PublicKey import RSA + +def bintopem(infile, outf): + f = open(infile, 'rb') + arr = f.read(264) + + n = int.from_bytes(struct.unpack_from("256B", arr, 0), 'little') + e = struct.unpack_from("