code: def get_fingerprint_from_public_key(pubkey):
      
  
      # TODO: why is there a tmpdir?
      with tempdir() as workdir:
          key = os.path.join(workdir, 'key.pub')
          with open(key, 'w') as fd:
              fd.write(pubkey)
  
          cmd = [
              'ssh-keygen',
              '-l',
              '-f', key,
          ]
  
          p = Subprocess(cmd)
          output = p.stdout.strip()
          bits, fingerprint, _ = output.split(' ', 2)
          return fingerprint
docs: Generate the fingerprint of a public key
  
      :param str pubkey: the value of the public key
      :returns: fingerprint
      :rtype: str