<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def fingerprint_from_file(filename):
 """Extract a fingerprint from a GPG public key file"""

    cmd = flatten([gnupg_bin(), gnupg_home(), filename])
    outp = stderr_output(cmd).split('\n')
    if not outp[0].startswith('pub'):
        raise CryptoritoError('probably an invalid gpg key')

    return outp[1].strip()