def get_private_key(platform, service, purpose, key_use, version, private_key, keys_folder):
private_key_data = get_file_contents(keys_folder, private_key)<EOL>private_key = load_pem_private_key(private_key_data.encode(), None, backend=backend)<EOL>pub_key = private_key.public_key()<EOL>pub_bytes = pub_key.public_bytes(Encoding.PEM, PublicFormat.SubjectPublicKeyInfo)<EOL>kid = _generate_kid_from_key(pub_bytes.decode())<EOL>key = _create_key(platform=platform, service=service, key_use=key_use,<EOL>key_type="<STR_LIT>", purpose=purpose, version=version,<EOL>public_key=pub_bytes.decode(), private_key=private_key_data)<EOL>return kid, key<EOL>
Loads a private key from the file system and adds it to a dict of keys
:param keys: A dict of keys
:param platform the platform the key is for
:param service the service the key is for
:param key_use what the key is used for
:param version the version of the key
:param purpose: The purpose of the private key
:param private_key: The name of the private key to add
:param keys_folder: The location on disk where the key exists
:param kid_override: This allows the caller to override the generated KID value
:return: None