PEP8 Blank Lines Style Issues, lp:1782596
This commit is contained in:
committed by
Scott Kitterman
parent
45266f6f05
commit
a1ca321fa5
@@ -39,6 +39,7 @@ BITS_REQUIRED = 2048
|
||||
# what openssl binary do we use to do key manipulation?
|
||||
OPENSSL_BINARY = '/usr/bin/openssl'
|
||||
|
||||
|
||||
def GenRSAKeys(private_key_file):
|
||||
""" Generates a suitable private key. Output is unprotected.
|
||||
You should encrypt your keys.
|
||||
@@ -47,6 +48,7 @@ def GenRSAKeys(private_key_file):
|
||||
subprocess.check_call([OPENSSL_BINARY, 'genrsa', '-out', private_key_file,
|
||||
str(BITS_REQUIRED)])
|
||||
|
||||
|
||||
def GenEd25519Keys(private_key_file):
|
||||
"""Generates a base64 encoded private key for ed25519 DKIM signing.
|
||||
Output is unprotected. You should encrypt your keys.
|
||||
@@ -62,6 +64,7 @@ def GenEd25519Keys(private_key_file):
|
||||
pkf.close()
|
||||
return(priv_key)
|
||||
|
||||
|
||||
def ExtractRSADnsPublicKey(private_key_file, dns_file):
|
||||
""" Given a key, extract the bit we should place in DNS.
|
||||
"""
|
||||
@@ -79,6 +82,7 @@ def ExtractRSADnsPublicKey(private_key_file, dns_file):
|
||||
print >> dns_fp, "k=rsa; h=sha256; p={0}".format(output)
|
||||
dns_fp.close()
|
||||
|
||||
|
||||
def ExtractEd25519PublicKey(private_key_file, dns_file, priv_key):
|
||||
""" Given a ed25519 key, extract the bit we should place in DNS.
|
||||
"""
|
||||
@@ -90,6 +94,7 @@ def ExtractEd25519PublicKey(private_key_file, dns_file, priv_key):
|
||||
print >> dns_fp, "k=ed25519; p={0}".format(output)
|
||||
dns_fp.close()
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(
|
||||
description='Produce DKIM keys.',)
|
||||
|
||||
Reference in New Issue
Block a user