??????????????
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 173

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 174

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 175

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 176

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 177

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 178
 Udac@`sddlmZmZmZeZidd6dgd6dd6ZdZd Zd Z dd l Z dd l Z dd l Z dd l Z dd lmZdd lmZddlmZmZddlmZmZmZddlmZdZdZeZ y/dd l!Z!dd l!mZee!j"Z#Wn#e$k rJe j%Z e&Z'n4Xe(Z'e!j)j*dkrrdZ+dZ,n dZ+dZ,eZ-ygdd l.Z.dd l/Z.dd l0Z.dd l1Z.dd l2Z.dd l3Z.dd l4Z.ee.j"Z5Wn#e$k re j%Z-e&Z6n"Xe(Z6e.j7j8j9dZ:dZ;dej<fdYZ=dej>fdYZ?de?fdYZ@de?fd YZAd!ZBeCd"kreBnd S(#i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust communityt supported_bysQ2 --- module: openssl_csr version_added: '2.4' short_description: Generate OpenSSL Certificate Signing Request (CSR) description: - This module allows one to (re)generate OpenSSL certificate signing requests. - It uses the pyOpenSSL python library to interact with openssl. This module supports the subjectAltName, keyUsage, extendedKeyUsage, basicConstraints and OCSP Must Staple extensions. - "Please note that the module regenerates existing CSR if it doesn't match the module's options, or if it seems to be corrupt. If you are concerned that this could overwrite your existing CSR, consider using the I(backup) option." - The module can use the cryptography Python library, or the pyOpenSSL Python library. By default, it tries to detect which one is available. This can be overridden with the I(select_crypto_backend) option. Please note that the PyOpenSSL backend was deprecated in Ansible 2.9 and will be removed in Ansible 2.13." requirements: - Either cryptography >= 1.3 - Or pyOpenSSL >= 0.15 author: - Yanis Guenane (@Spredzy) options: state: description: - Whether the certificate signing request should exist or not, taking action if the state is different from what is stated. type: str default: present choices: [ absent, present ] digest: description: - The digest used when signing the certificate signing request with the private key. type: str default: sha256 privatekey_path: description: - The path to the private key to use when signing the certificate signing request. - Required if I(state) is C(present). type: path privatekey_passphrase: description: - The passphrase for the private key. - This is required if the private key is password protected. type: str version: description: - The version of the certificate signing request. - "The only allowed value according to L(RFC 2986,https://tools.ietf.org/html/rfc2986#section-4.1) is 1." type: int default: 1 force: description: - Should the certificate signing request be forced regenerated by this ansible module. type: bool default: no path: description: - The name of the file into which the generated OpenSSL certificate signing request will be written. type: path required: true subject: description: - Key/value pairs that will be present in the subject name field of the certificate signing request. - If you need to specify more than one value with the same key, use a list as value. type: dict version_added: '2.5' country_name: description: - The countryName field of the certificate signing request subject. type: str aliases: [ C, countryName ] state_or_province_name: description: - The stateOrProvinceName field of the certificate signing request subject. type: str aliases: [ ST, stateOrProvinceName ] locality_name: description: - The localityName field of the certificate signing request subject. type: str aliases: [ L, localityName ] organization_name: description: - The organizationName field of the certificate signing request subject. type: str aliases: [ O, organizationName ] organizational_unit_name: description: - The organizationalUnitName field of the certificate signing request subject. type: str aliases: [ OU, organizationalUnitName ] common_name: description: - The commonName field of the certificate signing request subject. type: str aliases: [ CN, commonName ] email_address: description: - The emailAddress field of the certificate signing request subject. type: str aliases: [ E, emailAddress ] subject_alt_name: description: - SAN extension to attach to the certificate signing request. - This can either be a 'comma separated string' or a YAML list. - Values must be prefixed by their options. (i.e., C(email), C(URI), C(DNS), C(RID), C(IP), C(dirName), C(otherName) and the ones specific to your CA) - Note that if no SAN is specified, but a common name, the common name will be added as a SAN except if C(useCommonNameForSAN) is set to I(false). - More at U(https://tools.ietf.org/html/rfc5280#section-4.2.1.6). type: list elements: str aliases: [ subjectAltName ] subject_alt_name_critical: description: - Should the subjectAltName extension be considered as critical. type: bool aliases: [ subjectAltName_critical ] use_common_name_for_san: description: - If set to C(yes), the module will fill the common name in for C(subject_alt_name) with C(DNS:) prefix if no SAN is specified. type: bool default: yes version_added: '2.8' aliases: [ useCommonNameForSAN ] key_usage: description: - This defines the purpose (e.g. encipherment, signature, certificate signing) of the key contained in the certificate. type: list elements: str aliases: [ keyUsage ] key_usage_critical: description: - Should the keyUsage extension be considered as critical. type: bool aliases: [ keyUsage_critical ] extended_key_usage: description: - Additional restrictions (e.g. client authentication, server authentication) on the allowed purposes for which the public key may be used. type: list elements: str aliases: [ extKeyUsage, extendedKeyUsage ] extended_key_usage_critical: description: - Should the extkeyUsage extension be considered as critical. type: bool aliases: [ extKeyUsage_critical, extendedKeyUsage_critical ] basic_constraints: description: - Indicates basic constraints, such as if the certificate is a CA. type: list elements: str version_added: '2.5' aliases: [ basicConstraints ] basic_constraints_critical: description: - Should the basicConstraints extension be considered as critical. type: bool version_added: '2.5' aliases: [ basicConstraints_critical ] ocsp_must_staple: description: - Indicates that the certificate should contain the OCSP Must Staple extension (U(https://tools.ietf.org/html/rfc7633)). type: bool version_added: '2.5' aliases: [ ocspMustStaple ] ocsp_must_staple_critical: description: - Should the OCSP Must Staple extension be considered as critical - Note that according to the RFC, this extension should not be marked as critical, as old clients not knowing about OCSP Must Staple are required to reject such certificates (see U(https://tools.ietf.org/html/rfc7633#section-4)). type: bool version_added: '2.5' aliases: [ ocspMustStaple_critical ] select_crypto_backend: description: - Determines which crypto backend to use. - The default choice is C(auto), which tries to use C(cryptography) if available, and falls back to C(pyopenssl). - If set to C(pyopenssl), will try to use the L(pyOpenSSL,https://pypi.org/project/pyOpenSSL/) library. - If set to C(cryptography), will try to use the L(cryptography,https://cryptography.io/) library. - Please note that the C(pyopenssl) backend has been deprecated in Ansible 2.9, and will be removed in Ansible 2.13. From that point on, only the C(cryptography) backend will be available. type: str default: auto choices: [ auto, cryptography, pyopenssl ] version_added: '2.8' backup: description: - Create a backup file including a timestamp so you can get the original CSR back if you overwrote it with a new one by accident. type: bool default: no version_added: "2.8" create_subject_key_identifier: description: - Create the Subject Key Identifier from the public key. - "Please note that commercial CAs can ignore the value, respectively use a value of their own choice instead. Specifying this option is mostly useful for self-signed certificates or for own CAs." - Note that this is only supported if the C(cryptography) backend is used! type: bool default: no version_added: "2.9" subject_key_identifier: description: - The subject key identifier as a hex string, where two bytes are separated by colons. - "Example: C(00:11:22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:ff:00:11:22:33)" - "Please note that commercial CAs ignore this value, respectively use a value of their own choice. Specifying this option is mostly useful for self-signed certificates or for own CAs." - Note that this option can only be used if I(create_subject_key_identifier) is C(no). - Note that this is only supported if the C(cryptography) backend is used! type: str version_added: "2.9" authority_key_identifier: description: - The authority key identifier as a hex string, where two bytes are separated by colons. - "Example: C(00:11:22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:ff:00:11:22:33)" - If specified, I(authority_cert_issuer) must also be specified. - "Please note that commercial CAs ignore this value, respectively use a value of their own choice. Specifying this option is mostly useful for self-signed certificates or for own CAs." - Note that this is only supported if the C(cryptography) backend is used! - The C(AuthorityKeyIdentifier) will only be added if at least one of I(authority_key_identifier), I(authority_cert_issuer) and I(authority_cert_serial_number) is specified. type: str version_added: "2.9" authority_cert_issuer: description: - Names that will be present in the authority cert issuer field of the certificate signing request. - Values must be prefixed by their options. (i.e., C(email), C(URI), C(DNS), C(RID), C(IP), C(dirName), C(otherName) and the ones specific to your CA) - "Example: C(DNS:ca.example.org)" - If specified, I(authority_key_identifier) must also be specified. - "Please note that commercial CAs ignore this value, respectively use a value of their own choice. Specifying this option is mostly useful for self-signed certificates or for own CAs." - Note that this is only supported if the C(cryptography) backend is used! - The C(AuthorityKeyIdentifier) will only be added if at least one of I(authority_key_identifier), I(authority_cert_issuer) and I(authority_cert_serial_number) is specified. type: list elements: str version_added: "2.9" authority_cert_serial_number: description: - The authority cert serial number. - Note that this is only supported if the C(cryptography) backend is used! - "Please note that commercial CAs ignore this value, respectively use a value of their own choice. Specifying this option is mostly useful for self-signed certificates or for own CAs." - The C(AuthorityKeyIdentifier) will only be added if at least one of I(authority_key_identifier), I(authority_cert_issuer) and I(authority_cert_serial_number) is specified. type: int version_added: "2.9" extends_documentation_fragment: - files notes: - If the certificate signing request already exists it will be checked whether subjectAltName, keyUsage, extendedKeyUsage and basicConstraints only contain the requested values, whether OCSP Must Staple is as requested, and if the request was signed by the given private key. seealso: - module: openssl_certificate - module: openssl_dhparam - module: openssl_pkcs12 - module: openssl_privatekey - module: openssl_publickey s - name: Generate an OpenSSL Certificate Signing Request openssl_csr: path: /etc/ssl/csr/www.ansible.com.csr privatekey_path: /etc/ssl/private/ansible.com.pem common_name: www.ansible.com - name: Generate an OpenSSL Certificate Signing Request with a passphrase protected private key openssl_csr: path: /etc/ssl/csr/www.ansible.com.csr privatekey_path: /etc/ssl/private/ansible.com.pem privatekey_passphrase: ansible common_name: www.ansible.com - name: Generate an OpenSSL Certificate Signing Request with Subject information openssl_csr: path: /etc/ssl/csr/www.ansible.com.csr privatekey_path: /etc/ssl/private/ansible.com.pem country_name: FR organization_name: Ansible email_address: jdoe@ansible.com common_name: www.ansible.com - name: Generate an OpenSSL Certificate Signing Request with subjectAltName extension openssl_csr: path: /etc/ssl/csr/www.ansible.com.csr privatekey_path: /etc/ssl/private/ansible.com.pem subject_alt_name: 'DNS:www.ansible.com,DNS:m.ansible.com' - name: Generate an OpenSSL CSR with subjectAltName extension with dynamic list openssl_csr: path: /etc/ssl/csr/www.ansible.com.csr privatekey_path: /etc/ssl/private/ansible.com.pem subject_alt_name: "{{ item.value | map('regex_replace', '^', 'DNS:') | list }}" with_dict: dns_server: - www.ansible.com - m.ansible.com - name: Force regenerate an OpenSSL Certificate Signing Request openssl_csr: path: /etc/ssl/csr/www.ansible.com.csr privatekey_path: /etc/ssl/private/ansible.com.pem force: yes common_name: www.ansible.com - name: Generate an OpenSSL Certificate Signing Request with special key usages openssl_csr: path: /etc/ssl/csr/www.ansible.com.csr privatekey_path: /etc/ssl/private/ansible.com.pem common_name: www.ansible.com key_usage: - digitalSignature - keyAgreement extended_key_usage: - clientAuth - name: Generate an OpenSSL Certificate Signing Request with OCSP Must Staple openssl_csr: path: /etc/ssl/csr/www.ansible.com.csr privatekey_path: /etc/ssl/private/ansible.com.pem common_name: www.ansible.com ocsp_must_staple: yes s privatekey: description: Path to the TLS/SSL private key the CSR was generated for returned: changed or success type: str sample: /etc/ssl/private/ansible.com.pem filename: description: Path to the generated Certificate Signing Request returned: changed or success type: str sample: /etc/ssl/csr/www.ansible.com.csr subject: description: A list of the subject tuples attached to the CSR returned: changed or success type: list elements: list sample: "[('CN', 'www.ansible.com'), ('O', 'Ansible')]" subjectAltName: description: The alternative names this CSR is valid for returned: changed or success type: list elements: str sample: [ 'DNS:www.ansible.com', 'DNS:m.ansible.com' ] keyUsage: description: Purpose for which the public key may be used returned: changed or success type: list elements: str sample: [ 'digitalSignature', 'keyAgreement' ] extendedKeyUsage: description: Additional restriction on the public key purposes returned: changed or success type: list elements: str sample: [ 'clientAuth' ] basicConstraints: description: Indicates if the certificate belongs to a CA returned: changed or success type: list elements: str sample: ['CA:TRUE', 'pathLenConstraint:0'] ocsp_must_staple: description: Indicates whether the certificate has the OCSP Must Staple feature enabled returned: changed or success type: bool sample: false backup_file: description: Name of backup file created. returned: changed and if I(backup) is C(yes) type: str sample: /path/to/www.ansible.com.csr.2019-03-09@11:22~ N(t LooseVersion(tcrypto(t AnsibleModuletmissing_required_lib(t to_nativetto_bytestto_text(t ipaddresss0.15s1.3it tlsfeaturetstatus_requests1.3.6.1.5.5.7.1.24sDER:30:03:02:01:05s0tCertificateSigningRequestErrorcB`seZRS((t__name__t __module__(((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pyRstCertificateSigningRequestBasecB`sneZdZejdZdZejdZejdZe dZ dZ dZ RS(c C`stt|j|jd|jd|jd|j|jd|_|jd|_|jd|_|jd|_|jd|_ |jd |_ |jd |_ |jd |_ |jd |_ |jd |_|jd|_|jd|_|jd|_|jd|_|jd|_|jd|_|jd|_|jd|_|jd|_d|_d|_|jr|jdk r|jddn|jd|_d|_d|jdfd|jdfd|jdfd |jd!fd"|jd#fd$|jd%fd&|jd'fg|_|jd(rf|jtj |jd(|_ng|jD]$}|d)rp|d*|d)f^qp|_|j r|jd+rx<|jD].}|d*d2krd-|d)g|_ PqqWn|jdk rUy%t!j"|jj#d.d/|_WqUt$k rQ}t%d0j&|qUXn|jdk ry%t!j"|jj#d.d/|_Wqt$k r}t%d1j&|qXndS(3Ntpathtstatetforcetdigesttprivatekey_pathtprivatekey_passphrasetversiontsubject_alt_nametsubject_alt_name_criticalt key_usagetkey_usage_criticaltextended_key_usagetextended_key_usage_criticaltbasic_constraintstbasic_constraints_criticaltocsp_must_stapletocsp_must_staple_criticaltcreate_subject_key_identifiertsubject_key_identifiertauthority_key_identifiertauthority_cert_issuertauthority_cert_serial_numbertmsgsSsubject_key_identifier cannot be specified if create_subject_key_identifier is truetbackuptCt country_nametSTtstate_or_province_nametLt locality_nametOtorganization_nametOUtorganizational_unit_nametCNt common_namet emailAddresst email_addresstsubjectiituse_common_name_for_sant commonNamesDNS:%st:ts(Cannot parse subject_key_identifier: {0}s*Cannot parse authority_key_identifier: {0}(R>R8('tsuperRt__init__tparamst check_modeRRRRtsubjectAltNametsubjectAltName_criticaltkeyUsagetkeyUsage_criticaltextendedKeyUsagetextendedKeyUsage_criticaltbasicConstraintstbasicConstraints_criticaltocspMustStapletocspMustStaple_criticalR'R(R)R*R+tNonetrequestt privatekeyt fail_jsonR-t backup_fileR<t crypto_utilstparse_name_fieldtbinasciit unhexlifytreplacet ExceptionRtformat(tselftmoduletentrytsubte((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pyRBsn        #7 %%cC`sdS(N((R[((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pyt _generate_csrscC`s|j|dt s|jrh|j}|jrL|j|j|_ntj ||t |_ n|j |j }|j|trt |_ ndS(s)Generate the certificate signing request.tperms_requiredN(tchecktFalseRR`R-t backup_localRRSRTt write_filetTruetchangedtload_file_common_argumentsRCtset_fs_attributes_if_different(R[R\tresultt file_args((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pytgenerates   cC`sdS(N((R[((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pyt_load_private_key'scC`sdS(N((R[((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pyt _check_csr+scC`s9tt|j||}|j|s/tS|jS(s,Ensure the resource is in its desired state.(RARRbRmRcRn(R[R\Ratstate_and_perms((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pyRb/s  cC`s;|jr!|j|j|_ntt|j|dS(N(R-RdRRSRARtremove(R[R\((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pyRp:s cC`s}i |jd6|jd6|jd6|jd6|jd6|jd6|jd6|jd6|jd 6}|j ry|j |d sR@terrorstsurrogate_or_strictt,( tnextRtsplittstripRRERt get_criticalRFRcRf(Rt altnames_exttaltnameRtname(R[(sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pyt_check_subjectAltNamesF =c S`sg|D]}|j|kr|^q}| r8|sE|rI| rItS| r[| r[tSgt|djdD]'}tjjjt |j ^qu}g|D]!}tjjjt |^q}t |t |ko|dj |kSdS(NiR( RRcRfRRR{R|R}R~R RRR(RtextNametexpectedtcriticalRt usages_exttusagetcurrent((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pyt_check_keyUsage_s+G.c `sg|D]}|jdkr|^q}| r;jsK|rOj rOtS| rdj rdtStjdtdjjjd}|dj|jko|dj j kSdS(NRGs, Rwi( RRGRcRfR RRRtget_dataRRH(RRRt expected_ext(R[(sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pyt_check_keyUsages+ *c`s|djjS(NRI(RIRJ(R(RR[(sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pyt_check_extenededKeyUsagesc`s|djjS(NRK(RKRL(R(RR[(sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pyt_check_basicConstraintssc`sg|D]6}t|jtkrt|tkr|^q}tjjdkr|jg|D]0}|jdkrb|jdkrb|^qbnj rt |dko|dj j kSt |dkSdS(NitUNDEFs0i( R RRRR{tSSLtOPENSSL_VERSION_NUMBERtextendRRMRRRN(RRtoms_ext(R[(sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pyt_check_ocspMustStaples CG )c`sF|j}|oE|oE|oE|oE|S(N(tget_extensions(RR(RRRRR(sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pyt_check_extensionss c`s0y|jjSWntjk r+tSXdS(N(tverifyRQR RRc(R(R[(sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pyt_check_signaturestbackendt pyopenssl(RTtload_certificate_requestRRYRc(R[RRRRtdummy((RRRRRRR[sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pyRns  (RRRBR`RmRRn(((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pyRuSs   2  t%CertificateSigningRequestCryptographycB`s,eZdZdZdZdZRS(cC`sWtt|j|tjjj|_||_|j dkrS|j dndS(Nis_The cryptography backend only supports version 1. (The only valid value according to RFC 2986.)( RARRBt cryptographythazmattbackendstdefault_backendtcryptography_backendR\Rtwarn(R[R\((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pyRBs  c C`stjj}y[|jtjjg|jD]2}tjjtj|dt |d^q+}Wnt k r}t |nX|j r|j tjjg|j D]}tj|^qd|j}n|jrtj|j}|j tjj|d|j}n|jrrg|jD]}tj|^q0}|j tjj|d|j}n|jri}tj|j\}} |j tjj|| d|j}n|jr@y4|j tjjtjjjgd|j }Wq@t!k r<} |j tjj"t#t$d|j }q@Xn|j%ry|j tjj&j'|j(j)dt*}n6|j+dk r|j tjj&|j+dt*}n|j-dk s|j.dk s|j/dk rId} |j.dk rg|j.D]} tj| ^q} n|j tjj0|j-| |j/dt*}nd} tj1|j(r?|j2dkrtj3j4j5j6} q?|j2dkrtj3j4j5j7} q?|j2dkrtj3j4j5j8} q?|j2dkrtj3j4j5j9} q?|j2dkr$tj3j4j5j:} q?t d j;|j2ny"|j<|j(| |j=|_>WnJt?k r}t@|d kr| dkr|jAjBd d nnX|j>jCtj3j4jDjEjFS( NiiRtsha256tsha384tsha512tsha1tmd5sUnsupported digest "{0}"s.Algorithm must be a registered hash algorithm.R,sGSigning with Ed25519 and Ed448 keys requires cryptography 2.8 or newer.(GRtx509t CertificateSigningRequestBuildert subject_nametNameR<t NameAttributeRTtcryptography_name_to_oidRt ValueErrorRREt add_extensiontSubjectAlternativeNametcryptography_get_nameRFRGt#cryptography_parse_key_usage_paramstKeyUsageRHRItExtendedKeyUsageRJRKt"cryptography_get_basic_constraintstBasicConstraintsRLRMt TLSFeaturetTLSFeatureTypeRRNtAttributeErrortUnrecognizedExtensiontCRYPTOGRAPHY_MUST_STAPLE_NAMEtCRYPTOGRAPHY_MUST_STAPLE_VALUER'tSubjectKeyIdentifiertfrom_public_keyRQt public_keyRcR(ROR)R*R+tAuthorityKeyIdentifiert)cryptography_key_needs_digest_for_signingRRt primitivesthashestSHA256tSHA384tSHA512tSHA1tMD5RZRRRPt TypeErrorRR\RRt public_bytest serializationtEncodingtPEM(R[RR]R_RRCRRtcat path_lengthRtissuerstnR((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pyR`sxL ( ' %' * 4  '-( "c C`syjt|jdR}tjjjj|j|jdkrEdn t |jd|j |_ WdQXWnt k r}t|nXdS(NtrbR(topenRRRRRtload_pem_private_keytreadRROR RRQRYR(R[tfR_((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pyRmJs $c`sfd}dfdfdfdfdfdfdfd fd }fd }ytjjd d }Wntk r}tSX||o||o||S(Nc`sqgjD]#}tj|d|df^q }g|jD]}|j|jf^q=}t|t|kS(Nii(R<RTRtoidtvalueR(RR]R<R^R(R[(sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pyRVs3(c`stfd|DdS(Nc3`s'|]}t|jr|VqdS(N(t isinstanceR (RR(texttype(sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pys ]s(RRO(RR ((R sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pyt_find_extension[sc`s|tjj}|r=g|jD]}t|^q%ng}jrwgjD]!}ttj|^qVng}t|t|krt S|r|j j krt Snt S(N( RRRR RRERTRRRcRRFRf(Rtcurrent_altnames_extRtcurrent_altnamesR(R R[(sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pyRas.:c`s|tjj}js(|dkS|dkr8tStjj}x2|D]*}t|j d|||krQtSqQW|j j krtSt S(Nt_( RRRRGRORcRTRtgetattrR RRHRf(Rtcurrent_keyusage_extRCtparam(R R[(sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pyRls     c`s|tjj}|r=g|jD]}t|^q%ng}jrwgjD]!}ttj|^qVng}t|t|krt S|r|j j krt Snt S(N( RRRR RRIRTRRRcRRJRf(Rtcurrent_usages_extRtcurrent_usagesR(R R[(sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pyRzs.:c`s|tjj}|r'|jjnt}|r?|jjnd}tj j \}}||krmtS||kr}tSj r|dk o|j j kS|dkSdS(N( RRRR RRcRRORTRRKRRL(Rtbc_extt current_catcurrent_path_lengthRR(R R[(sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pyRs   c`sy|tjj}t}Wn2tk rS}td|Dd}t}nXjr| sv|j j krztS|rtjj j |j kS|j j tkSn |dkSdS(Ncs`s'|]}|jjtkr|VqdS(N(R RR(RR((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pys s(RRRRfRRRORcRMRRNRRR R(Rttlsfeature_extthas_tlsfeatureR(R R[(sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pyRs     c`s|tjj}js-jdk r| s=|jrAtSjr{tjjjj j j }|j j |kS|j j jkSn |dkSdS(N( RRRR'R(RORRcRRQRRR (RRR(R R[(sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pyt_check_subject_key_identifiers !c`s|tjj}jdk sBjdk sBjdk r | sR|jrVtSd}d}jdk rgjD]}t t j |^q{}n|j jdk rg|j jD]}t |^q}n|j j jko ||ko |j jjkS|dkSdS(N(RRRR)ROR*R+RRcRRTRR tkey_identifier(RRtacitcsr_aciR(R R[(sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pyt_check_authority_key_identifiers-.( c`s[|j}|oZ|oZ|oZ|oZ|oZ|oZ|S(N(R(RR(RRRRRRR(sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pyRs  c`s|js tS|jjtjjjjj tjjjj j }j jjtjjjjj tjjjj j }||kS(N( tis_signature_validRcRRRRRRRRt PublicFormattSubjectPublicKeyInfoRQ(Rtkey_atkey_b(R[(sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pyRs  RR(RTRRRYRc(R[RRRRR(( RRRRRRRR R[sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pyRnUs     !(RRRBR`RmRn(((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pyRs  N cMC`sItdtdtdddddddgd tdddd d tdd d tdddtdtdddddtdddtd tdd dtdtdddtdddddgdtdddddgdtddddd gd!tdddd"d#gd$tdddd%d&gd'tdddd(d)gd*tdddd+d,gd-tdd.d/ddd0gd1tdddtdd2gd3tdddtdd4gd5tdd.d/ddd6gd7tdddtdd8gd9tdd.d/ddd:d;gd<tdddtdd=d>gd?tdd.d/ddd@gdAtdddtddBgdCtdddtddDgdEtdddtddFgdGtdddtdHtdddtdItdddJtdddKtdd.d/ddLtdddMtddddNddNdOdPg!dQdbgdRddd gfgdStdTt}tjj|jd pdU}tjj|s|j dV|dWdX|n|jdM}|dNkrdt ot t t k}tott tk}|r'dO}n|r6dP}n|dNkrd|j dWdYjt tqdny|dPkrts|j dWtdZjtd[tnyttjd\Wn!tk r|j dWd]nX|jd^dd_t|}nI|dOkrDt s5|j dWtd`jt d[tnt|}n|jddkr|jr|j}|jdp|j| |da<|j|n|j |nO|jr|j}tjj!|jd |da<|j|n|j"||j}|j|Wn,t#j$k rD}|j dWt%|nXdS(cNt argument_specRttypeRtdefaulttpresenttchoicestabsentRRRRRtno_logRtintiRtbooltrequiredR<tdictR/taliasesR.t countryNameR1R0tstateOrProvinceNameR3R2t localityNameR5R4torganizationNameR7R6torganizationalUnitNameR9R8R>R;tER:RtlisttelementsRERRFR=tuseCommonNameForSANRRGR RHR!t extKeyUsageRIR"textKeyUsage_criticalRJR#RKR$RLR%RMR&RNR-R'R(R)R*R+tselect_crypto_backendtautoRRtrequired_togethert required_iftadd_file_common_argstsupports_check_modet.RR,s>The directory %s does not exist or the file is not a directorys]Can't detect any of the required Python libraries cryptography (>= {0}) or PyOpenSSL (>= {1})spyOpenSSL >= {0}t exceptionRs1You need to have PyOpenSSL>=0.15 to generate CSRssKThe module is using the PyOpenSSL backend. This backend has been deprecateds2.13scryptography >= {0}Rg(R*R+(&R R.RfRctosRtdirnameRCtisdirRRtCRYPTOGRAPHY_FOUNDtCRYPTOGRAPHY_VERSIONRtMINIMAL_CRYPTOGRAPHY_VERSIONtPYOPENSSL_FOUNDtPYOPENSSL_VERSIONtMINIMAL_PYOPENSSL_VERSIONRZR tPYOPENSSL_IMP_ERRRR RxRt deprecateRutCRYPTOGRAPHY_IMP_ERRRRDRrRbt exit_jsonRltexistsRpRTtOpenSSLObjectErrorR (R\tbase_dirRtcan_use_cryptographytcan_use_pyopensslRRjR((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pytmains!!!'              !    t__main__(Dt __future__RRRR%t __metaclass__tANSIBLE_METADATAt DOCUMENTATIONtEXAMPLEStRETURNRsRVRCt tracebacktdistutils.versionRtansible.module_utilsR RTtansible.module_utils.basicR R tansible.module_utils._textR R Rtansible.module_utils.compatRRRKRHRORLR{t __version__RJt ImportErrort format_excRcRIRfRRRRRNRtcryptography.x509tcryptography.x509.oidtcryptography.exceptionstcryptography.hazmat.backendst,cryptography.hazmat.primitives.serializationt%cryptography.hazmat.primitives.hashesRGRFRRtObjectIdentifierRRRQRt OpenSSLObjectRRuRRUR(((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssl_csr.pytsp   A6                    i