Added revoke support to cfssl plugin (#1007)

* Added revoke support to cfssl plugin
This commit is contained in:
Johannes Langer
2017-11-29 23:33:22 +01:00
committed by kevgliss
parent dfb9e3a0c8
commit 5ac3ecb85e
3 changed files with 79 additions and 3 deletions

View File

@ -53,6 +53,14 @@ def parse_certificate(body):
return x509.load_pem_x509_certificate(body, default_backend())
def get_authority_key(body):
"""Returns the authority key for a given certificate in hex format"""
parsed_cert = parse_certificate(body)
authority_key = parsed_cert.extensions.get_extension_for_class(
x509.AuthorityKeyIdentifier).value.key_identifier
return authority_key.hex()
def generate_private_key(key_type):
"""
Generates a new private key based on key_type.