mirror of
https://github.com/JJTech0130/pypush.git
synced 2025-01-22 19:30:56 +00:00
12 lines
503 B
Python
12 lines
503 B
Python
from collections import namedtuple
|
|
|
|
USER_AGENT = "com.apple.madrid-lookup [macOS,13.2.1,22D68,MacBookPro18,3]"
|
|
PROTOCOL_VERSION = "1640"
|
|
|
|
# KeyPair is a named tuple that holds a key and a certificate in PEM form
|
|
KeyPair = namedtuple("KeyPair", ["key", "cert"])
|
|
|
|
def dearmour(armoured: str) -> str:
|
|
import re
|
|
# Use a regex to remove the header and footer (generic so it work on more than just certificates)
|
|
return re.sub(r"-----BEGIN .*-----|-----END .*-----", "", armoured).replace("\n", "") |