Move header extraction to python script and improve compatibility.

This commit is contained in:
Gus Kenion 2024-04-22 13:57:44 +02:00
parent 005639c032
commit 86bc49c244

22
headerextract.py Normal file
View File

@ -0,0 +1,22 @@
import sys
#inFile = sys.stdin
beginSig = "-----BEGIN PGP"
endSig = "-----END PGP"
output = ""
keyBegun = False
for line in sys.stdin:
sigIndex = 0
if beginSig in line:
if keyBegun:
exit(1)
keyBegun = True
sigIndex = line.find(beginSig)
if keyBegun:
output += line[sigIndex:]
if endSig in line:
break
print(output)