code: def RFC3156_micalg_from_algo(hash_algo):
      
      # hash_algo will be something like SHA256, but we need pgp-sha256.
      algo = gpg.core.hash_algo_name(hash_algo)
      if algo is None:
          raise GPGProblem('Unknown hash algorithm {}'.format(algo),
                           code=GPGCode.INVALID_HASH_ALGORITHM)
      return 'pgp-' + algo.lower()
docs: Converts a GPGME hash algorithm name to one conforming to RFC3156.
  
      GPGME returns hash algorithm names such as "SHA256", but RFC3156 says that
      programs need to use names such as "pgp-sha256" instead.
  
      :param str hash_algo: GPGME hash_algo
      :returns: the lowercase name of of the algorithm with "pgp-" prepended
      :rtype: str