File: //usr/lib64/python3.9/site-packages/rct/__pycache__/cert_commands.cpython-39.opt-1.pyc
a
X�Zh� � @ s� d dl Z d dlZd dlmZmZ d dlmZ d dlmZ d dl m
Z
mZ d dlm
Z
d dlmZ G dd � d e�ZG d
d� de�ZG dd
� d
e�ZdS )� N)�certificate�_certificate)�EntitlementCertificate)�
RCTCliCommand)�printc�type_to_string)�InvalidCLIOptionError)�ugettextc @ s. e Zd Zddd�Zdd� Zdd � Zd
d� ZdS )
�RCTCertCommand�cliNFc C s t j| ||||d� d S )N��name�aliases� shortdesc�primary)r �__init__)�selfr
r r r � r �7/usr/lib64/python3.9/site-packages/rct/cert_commands.pyr s zRCTCertCommand.__init__c C s t d�j| jd�S )Nz#%(prog)s {name} [OPTIONS] CERT_FILE)r
)�_�formatr
�r r r r �
_get_usage s zRCTCertCommand._get_usagec
C sV | � � }zt�|�W S tjyP } z"ttd�j||d���W Y d }~n
d }~0 0 d S )Nz<Unable to read certificate file '{certificate}': {exception})r � exception)�_get_file_from_argsr Zcreate_from_fileZCertificateExceptionr r r )r � cert_fileZcer r r �_create_cert# s ��zRCTCertCommand._create_certc C s4 | � � }|sttd���tj�|�s0ttd���d S )Nz$You must specify a certificate file.z.The specified certificate file does not exist.)r r r �os�path�isfile)r r r r r �_validate_options. s
z RCTCertCommand._validate_options)r NNF)�__name__�
__module__�__qualname__r r r r r r r r r
s
r
c @ s e Zd Zdd� Zdd� ZdS )�CatCertCommandc C sN t j| ddgtd�dd� | jjdddtd �d
� | jjdddtd
�d
� d S )Nzcat-certZcczPrint certificate informationTr z
--no-products�no_products�
store_truez*do not show the cert's product information)�dest�action�helpz--no-content�
no_contentz#do not show the cert's content info)r r r �parser�add_argumentr r r r r 8 s&