HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/states/__pycache__/win_pki.cpython-310.pyc
o

�N�g=�@s@dZdZdZdZdd�Zeeedddfd	d
�Zeefdd�Zd
S)zw
Microsoft certificate management via the Pki PowerShell module.

:platform:      Windows

.. versionadded:: 2016.11.0
ZLocalMachineZcerZMycCsdtvrdSdS)z<
    Load only on minions that have the win_pki module.
    zwin_pki.get_storesT)Fz"win_pki module could not be loaded)�__salt__�rr�G/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/win_pki.py�__virtual__srT��basec	Cs,|t�ddd�}d|�d|��}td||�}	td||d�}
|r+td	|	||d
�}ntd	|	|d�}|d|
vrId
�|d|�|d<d|d<|Stdrbd�|d|�|d<d|dd�|d<|Sd|dd�|d<td|||||||d�|d<|dr�d�|d|�|d<|Sd�|d|�|d<|S)a�
    Import the certificate file into the given certificate store.

    :param str name: The path of the certificate file to import.
    :param str cert_format: The certificate format. Specify 'cer' for X.509, or 'pfx' for PKCS #12.
    :param str context: The name of the certificate store location context.
    :param str store: The name of the certificate store.
    :param bool exportable: Mark the certificate as exportable. Only applicable to pfx format.
    :param str password: The password of the certificate. Only applicable to pfx format.
    :param str saltenv: The environment the file resides in.

    Example of usage with only the required arguments:

    .. code-block:: yaml

        site0-cert-imported:
            win_pki.import_cert:
                - name: salt://win/webserver/certs/site0.cer

    Example of usage specifying all available arguments:

    .. code-block:: yaml

        site0-cert-imported:
            win_pki.import_cert:
                - name: salt://win/webserver/certs/site0.pfx
                - cert_format: pfx
                - context: LocalMachine
                - store: My
                - exportable: True
                - password: TestPassword
                - saltenv: base
    rN��name�changes�comment�result�Cert:\�\z
cp.cache_file�win_pki.get_certs��context�storezwin_pki.get_cert_file)r�cert_format�password)rr�
thumbprintz/Certificate '{}' already contained in store: {}r
Tr�testz0Certificate '{}' will be imported into store: {}��old�newr	zwin_pki.import_cert)rrrr�
exportabler�saltenvz(Certificate '{}' imported into store: {}z5Certificate '{}' unable to be imported into store: {}��dictr�formatZ__opts__)rrrrrrr�ret�
store_pathZcached_source_path�
current_certsZ
cert_propsrrr�import_certsV*������
�	�	���r!cCs�|t�ddd�}d|�d|��}td||d�}||vr*d�||�|d	<d
|d<|Stdr?d
�||�|d	<|dd�|d<|S|dd�|d<td|||d�|d<|dr_d�||�|d	<|Sd�||�|d	<|S)a
    Remove the certificate from the given certificate store.

    :param str thumbprint: The thumbprint value of the target certificate.
    :param str context: The name of the certificate store location context.
    :param str store: The name of the certificate store.

    Example of usage with only the required arguments:

    .. code-block:: yaml

        site0-cert-removed:
            win_pki.remove_cert:
                - thumbprint: 9988776655443322111000AAABBBCCCDDDEEEFFF

    Example of usage specifying all available arguments:

    .. code-block:: yaml

        site0-cert-removed:
            win_pki.remove_cert:
                - thumbprint: 9988776655443322111000AAABBBCCCDDDEEEFFF
                - context: LocalMachine
                - store: My
    rNrrr
rrz/Certificate '{}' already removed from store: {}r
Trrz/Certificate '{}' will be removed from store: {}rr	zwin_pki.remove_cert)rrrz'Certificate '{}' removed from store: {}z4Certificate '{}' unable to be removed from store: {}r)rrrrrrr rrr�remove_certrs:����
��	���r"N)�__doc__Z_DEFAULT_CONTEXTZ_DEFAULT_FORMATZ_DEFAULT_STORErr!r"rrrr�<module>s
�[