<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _write_apt_gpg_keyfile(key_name, key_material):
 """Writes GPG key material into a file at a provided path. :param key_name: A key name to use for a key file (could be a fingerprint) :type key_name: str :param key_material: A GPG key material (binary) :type key_material: (str, bytes) """

    with open('/etc/apt/trusted.gpg.d/{}.gpg'.format(key_name),
              'wb') as keyf:
        keyf.write(key_material)