File: //usr/lib/python3/dist-packages/landscape/lib/__pycache__/gpg.cpython-310.pyc
o
�1Db � @ sN d dl Z d dlZd dlZd dlmZ d dlmZ G dd� de�Zd
dd �ZdS )� N)�glob)�getProcessOutputAndValuec @ s e Zd ZdZdS )�InvalidGPGSignaturez:Raised when the gpg signature for a given file is invalid.N)�__name__�
__module__�__qualname__�__doc__� r r �3/usr/lib/python3/dist-packages/landscape/lib/gpg.pyr
s r �/usr/bin/gpg�/etc/aptc s� �fdd�}� fdd�}t �� �ttjdd� ttd�|��td�|�� �D �� �}d d
�ddf| d
|| f }t� |d�}|� |� |�
|� |S )a� Verify the GPG signature of a file.
@param filename: Path to the file to verify the signature against.
@param signature: Path to signature to use.
@param gpg: Optionally, path to the GPG binary to use.
@param apt_dir: Optionally, path to apt trusted keyring.
@return: a C{Deferred} resulting in C{True} if the signature is
valid, C{False} otherwise.
c s t �� � | S )N)�shutil�rmtree)�ignored)�gpg_homer r
�remove_gpg_home s
z#gpg_verify.<locals>.remove_gpg_homec s@ | \}}}|� d�|� d�}}|dkrtd� |||f ��d S )N�asciir z)%s failed (out='%s', err='%s', code='%d'))�decoder )�args�out�err�code)�gpgr r
�check_gpg_exit_code s
��z'gpg_verify.<locals>.check_gpg_exit_codec S s g | ]}d |f�qS )z --keyringr )�.0�keyringr r r
�
<listcomp>'