%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/states/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/states/mac_keychain.pyc

�
���^c@@s�dZddlmZmZmZddlZddlZddlZej	e
�ZdZd�Z
dd�Zddd�Zd	dd
�ZdS(u�
Installing of certificates to the keychain
==========================================

Install certificats to the macOS keychain

.. code-block:: yaml

    /mnt/test.p12:
      keychain.installed:
        - password: test123
i(tabsolute_importtunicode_literalstprint_functionNukeychaincC@stjjj�rtStS(u
    Only work on Mac OS
    (tsalttutilstplatformt	is_darwint__virtualname__tFalse(((s</usr/lib/python2.7/site-packages/salt/states/mac_keychain.pyt__virtual__su"/Library/Keychains/System.keychainc
K@s�i|d6td6dd6id6}d|ks:d|krMtd|�}ntd	|�}td
||�}||kr7td||�}td|�}||kr7td||d
|jd��}	d|	kr
|dcd7<||dd<td	|�}q4t|d<|dcdj|�7<|Sq7n||kr�td||||�}	d|	kry||dd<q�t|d<|dcdj|�7<n|dcdj|�7<|S(u�
    Install a p12 certificate file into the macOS keychain

    name
        The certificate to install

    password
        The password for the certificate being installed formatted in the way
        described for openssl command in the PASS PHRASE ARGUMENTS section

    keychain
        The keychain to install the certificate to, this defaults to
        /Library/Keychains/System.keychain

    allow_any
        Allow any application to access the imported certificate without warning

    keychain_password
        If your keychain is likely to be locked pass the password and it will be unlocked
        before running the import

    unameuresultuucommentuchangesuhttpusaltu
cp.cache_fileukeychain.list_certsukeychain.get_friendly_nameukeychain.get_hashukeychain.uninstalltkeychain_passwordukeychain_passworduunableuHFound a certificate with the same name but different hash, removing it.
uuninstalledu;Found an incorrect cert but was unable to uninstall it: {0}ukeychain.installuimportedu	installeduFailed to install {0}u{0} already installed.(tTruet__salt__tgetRtformat(
tnametpasswordtkeychaintkwargstrettcertst
friendly_namet	file_hasht
keychain_hashtout((s</usr/lib/python2.7/site-packages/salt/states/mac_keychain.pyt	installed$s:




cC@si|d6td6dd6id6}td|�}d|krd|ksVd	|kritd
|�}ntd||�}n|}||kr�td|||�}d
|kr�||dd<qt|d<|dcdj|�7<n|dcdj|�7<|S(u�
    Uninstall a p12 certificate file from the macOS keychain

    name
        The certificate to uninstall, this can be a path for a .p12 or the friendly
        name

    password
        The password for the certificate being installed formatted in the way
        described for openssl command in the PASS PHRASE ARGUMENTS section

    cert_name
        The friendly name of the certificate, this can be used instead of giving a
        certificate

    keychain
        The keychain to remove the certificate from, this defaults to
        /Library/Keychains/System.keychain

    keychain_password
        If your keychain is likely to be locked pass the password and it will be unlocked
        before running the import

    unameuresultuucommentuchangesukeychain.list_certsu.p12uhttpusaltu
cp.cache_fileukeychain.get_friendly_nameukeychain.uninstalluunableuuninstalleduFailed to uninstall {0}u{0} already uninstalled.(RRRR(RRRR
RRRR((s</usr/lib/python2.7/site-packages/salt/states/mac_keychain.pytuninstalledes$


uusercC@s�i|d6td6dd6id6}tjj|�sZt|d<|dcdj|�7<n�td||�}||kr�|dcdj|�7<nVtd	|||�}t|�d
kr�||dd<nt|d<dj|�|d<|S(
u�
    Set the default keychain to use

    name
        The chain in which to use as the default

    domain
        The domain to use valid values are user|system|common|dynamic, the default is user

    user
        The user to run as

    unameuresultuucommentuchangesuKeychain not found at {0}ukeychain.get_default_keychainu%{0} was already the default keychain.ukeychain.set_default_keychainiudefaultuFailed to install keychain. {0}(RtostpathtexistsRRRtlen(RtdomaintuserRR((s</usr/lib/python2.7/site-packages/salt/states/mac_keychain.pytdefault_keychain�s 



(t__doc__t
__future__RRRtloggingRtsalt.utils.platformRt	getLoggert__name__tlogRR	RtNoneRR!(((s</usr/lib/python2.7/site-packages/salt/states/mac_keychain.pyt<module>
s		A5

Zerion Mini Shell 1.0