blob: 1e58b40958ca914520d59bd7b9fb1c76ab4f7e2f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
from re import search
def getPemContent(pem, template):
pattern = template.format(content="(.*)")
return search("".join(pattern.splitlines()), "".join(pem.splitlines())).group(1)
def createPem(content, template):
lines = [
content[start:start + 64]
for start in range(0, len(content), 64)
]
return template.format(content="\n".join(lines))
|