KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /usr/lib64/python2.4/site-packages/M2Crypto/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/lib64/python2.4/site-packages/M2Crypto/X509.pyo
m
lPc@sadZdklZlZlZlZdkZdefdYZei	eei
ZdddZdfd	YZ
d
fdYZdfd
YZdfdYZdfdYZdZdZdZdfdYZdfdYZdfdYZdZdfdYZdZdfd YZd!ZdS("sM2Crypto wrapper for OpenSSL X509 API.

Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved.

Portions created by Open Source Applications Foundation (OSAF) are
Copyright (C) 2004-2005 OSAF. All Rights Reserved.
Author: Heikki Toivonen
(sASN1sBIOsErrsEVPNt	X509ErrorcBstZRS(N(t__name__t
__module__(((t3/usr/lib64/python2.4/site-packages/M2Crypto/X509.pyRsiicCsSti}ti|}ti||||}t	||}|i||S(s-
    Create new X509_Extension instance.
    N(tm2tx509v3_lhashtlhashtx509v3_set_conf_lhashtctxtx509v3_ext_conftnametvaluetx509_ext_ptrtX509_Extensiont_pyfreetx509_exttset_criticaltcritical(R
RRRRRRR((Rt
new_extensions
R
cBs_tZdZeiZeddZdZdZ	ddZ
dZdZdZ
RS(	s
    X509 Extension
    icCs||_||_dS(N(RtselfRR(RRR((Rt__init__'s	cCs5t|ddo|io|i|indS(NRi(tgetattrRRtm2_x509_extension_free(R((Rt__del__+scCs|iS(N(RR(R((Rt_ptr/scCsti|i|S(sL
        Mark this extension critical or noncritical. By default an
        extension is not critical.

        @type critical:  int
        @param critical: Nonzero sets this extension as critical.
                         Calling this method without arguments will
                         set this extension to critical.
        N(Rtx509_extension_set_criticalRRR(RR((RR2s	cCsti|iS(s
        Return whether or not this is a critical extension.

        @rtype:   int
        @return:  Nonzero if this is a critical extension.
        N(Rtx509_extension_get_criticalRR(R((Rtget_critical>scCsti|iS(sG
        Get the extension name, for example 'subjectAltName'.
        N(Rtx509_extension_get_nameRR(R((Rtget_nameGscCs5ti}ti|i|idd|iS(sM
        Get the extension value, for example 'DNS:www.example.com'.
        iN(	tBIOtMemoryBuffertbufRtx509_ext_printtbio_ptrRRtread_all(RR ((Rt	get_valueMs(RRt__doc__Rtx509_extension_freeRtNoneRRRRRRR$(((RR
 s						tX509_Extension_StackcBsetZdZeiZeddZdZdZ	dZ
dZdZdZ
d	ZRS(
sZ
    X509 Extension Stack
    
    @warning: Do not modify the underlying OpenSSL stack
    except through this interface, or use any OpenSSL functions that do so
    indirectly. Doing so will get the OpenSSL stack and the internal pystack
    of this class out of sync, leading to python memory leaks, exceptions
    or even python crashes!
    icCs|dj	oj||_||_ti|i}xdt|D]1}|i	i
tti|i|d|q>Wn"ti
|_d|_g|_	dS(NRi(tstackR'RRRtsk_x509_extension_numtnumtrangetitpystacktappendR
tsk_x509_extension_valuetsk_x509_extension_new_null(RR)RR-R+((RRcs
		
	cCs+t|ddo|i|indS(NRi(RRtm2_sk_x509_extension_freeR)(R((RRpscCs
t|iS(N(tlenRR.(R((Rt__len__tscCs|i|S(N(RR.tidx(RR5((Rt__getitem__xscCs
t|iS(N(titerRR.(R((Rt__iter__{scCs|iS(N(RR)(R((RR~scCs/|ii|ti|i|i}|S(s
        Push X509_Extension object onto the stack.

        @type x509_ext: M2Crypto.X509.X509_Extension
        @param x509_ext: X509_Extension object to be pushed onto the stack.
        @return: The number of extensions on the stack.
        N(	RR.R/RRtsk_x509_extension_pushR)Rtret(RRR:((Rtpushs
cCs4ti|i}|djodSn|iiS(sk
        Pop X509_Extension object from the stack.
        
        @return: X509_Extension popped
        N(Rtsk_x509_extension_popRR)RR'R.tpop(RR((RR=s
(RRR%Rtsk_x509_extension_freeR2R'RRR4R6R8RR;R=(((RR(Vs		
						
tX509_Name_EntrycBsPtZdZeiZddZdZdZdZ	dZ
dZRS(s
    X509 Name Entry
    icCs||_||_dS(N(tx509_name_entryRR(RR@R((RRs	cCs+t|ddo|i|indS(NRi(RRtm2_x509_name_entry_freeR@(R((RRscCs|iS(N(RR@(R((RRscCsti|i|iS(N(Rtx509_name_entry_set_objectRR@tasn1objR(RRC((Rt
set_objectscCstiti|iS(N(tASN1tASN1_StringRtx509_name_entry_get_dataRR@(R((Rtget_datascCs"ti|ii||||S(N(	Rtx509_name_entry_create_by_txtRR@RtfieldttypetentryR3(RRJRKRLR3((Rt
create_by_txts(RRR%Rtx509_name_entry_freeRARRRRDRHRM(((RR?s					t	X509_NamecBstZdZhdei<dei<dei<dei<dei<dei<dei<dei<d	ei<d
ei<dei	<dei	<d
ei
<dei
<dei<dei<dei<dei
<dei
<ZeiZeddZdZdZdZdZdZdZdZdZdZdZd Zdeid!ZRS("s
    X509 Name
    tCtSPtSTtstateOrProvinceNametLtlocalityNametOtorganizationNametOUtorganizationUnitNametCNt
commonNametEmailtemailAddresstserialNumbertSNtsurnametGNt	givenNameicCs?|dj	o||_||_nti|_d|_dS(Ni(t	x509_nameR'RRRt
x509_name_new(RRcR((RRs
	
cCs+t|ddo|i|indS(NRi(RRtm2_x509_name_freeRc(R((RRscCsti|iS(N(Rtx509_name_onelineRRc(R((Rt__str__scCs`||ijoti|i|i|Sn||ijo|i|Snt||fdS(N(tattrRtnidRtx509_name_by_nidRct__dict__tAttributeError(RRh((Rt__getattr__scCsB||ijo!ti|i|i||Sn||i|<dS(N(RhRRiRtx509_name_set_by_nidRcRRk(RRhR((Rt__setattr__s!cCsti|iS(N(Rtx509_name_entry_countRRc(R((RR4scCsMd|jo|ijnptdntti|i|S(Nisindex out of range(R5Rtentry_countt
IndexErrorR?Rtx509_name_get_entryRc(RR5((RR6s$ccs)x"t|iD]}||VqWdS(N(txrangeRRqR-(RR-((RR8scCs|iS(N(RRc(R((RRscCs"ti|i||||||S(N(
Rtx509_name_add_entry_by_txtRRcRJRKRLR3tloctset(RRJRKRLR3RvRw((Rtadd_entry_by_txtscCsti|iS(N(RRpRRc(R((RRqscCsZg}d}xGto?ti|i||}|djoPn|i||qW|S(Ni(	R:tlastpostTrueRtx509_name_get_index_by_nidRRcRiR/(RRiRyR:((Rtget_entries_by_nids	
cCs5ti}ti|i|i|||i
S(s
        as_text returns the name as a string.
        
        @param indent: Each line in multiline format is indented 
                       by this many spaces.
        @param flags:  Flags that control how the output should be formatted.
        N(RRR Rtx509_name_print_exR"RRctindenttflagsR#(RR~RR ((Rtas_texts
( RRR%RtNID_countryNametNID_stateOrProvinceNametNID_localityNametNID_organizationNametNID_organizationalUnitNametNID_commonNametNID_pkcs9_emailAddresstNID_serialNumbertNID_surnamet
NID_givenNameRitx509_name_freeReR'RRRgRmRoR4R6R8RRxRqR|tXN_FLAG_COMPATR(((RROs 					
								tX509cBs7tZdZeiZeddZdZdZ	dZ
dZdZdZ
d	Zd
ZdZdZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!dZ"edZ#dZ$d Z%RS(!s
    X.509 Certificate
    icCs?|dj	o||_||_nti|_d|_dS(Ni(tx509R'RRRtx509_new(RRR((RR.s
	
cCs+t|ddo|i|indS(NRi(RRtm2_x509_freeR(R((RR7scCs|iS(N(RR(R((RR;scCs/ti}ti|i|i|iS(N(	RRR Rt
x509_printR"RRR#(RR ((RR?scCs/ti}ti|i|i|iS(N(	RRR Rti2d_x509R"RRR#(RR ((Rtas_derEscCs/ti}ti|i|i|iS(N(	RRR Rtx509_write_pemR"RRR#(RR ((Rtas_pemKscCs+ti|d}ti|i|iS(s
        save_pem
        twbN(	RtopenfiletfilenametbioRRR"RR(RRR((Rtsave_pemPscCsti|i|S(s
        Set version.

        @type version:  int
        @param version: Version number.
        @rtype:         int
        @return:        Returns 0 on failure.
        N(Rtx509_set_versionRRtversion(RR((Rtset_versionWscCsti|i|iS(N(Rtx509_set_not_beforeRRtasn1_utctimeR(RR((Rtset_not_beforecscCsti|i|iS(N(Rtx509_set_not_afterRRRR(RR((Rt
set_not_aftergscCsti|i|iS(N(Rtx509_set_subject_nameRRR
Rc(RR
((Rtset_subject_namekscCsti|i|iS(N(Rtx509_set_issuer_nameRRR
Rc(RR
((Rtset_issuer_nameoscCsti|iS(N(Rtx509_get_versionRR(R((Rtget_versionsscCsti|i}ti|S(N(Rtx509_get_serial_numberRRtasn1_integertasn1_integer_get(RR((Rtget_serial_numberwscCs"ti|i}ti||S(sh
        Set serial number.

        @type serial:   int
        @param serial:  Serial number.
        N(RRRRRtasn1_integer_settserial(RRR((Rtset_serial_number|scCstiti|iS(N(REtASN1_UTCTIMERtx509_get_not_beforeRR(R((Rtget_not_beforescCstiti|iS(N(RERRtx509_get_not_afterRR(R((Rt
get_not_afterscCstiti|iddS(NRi(tEVPtPKeyRtx509_get_pubkeyRR(R((Rt
get_pubkeyscCsti|i|iS(sw
        Set the public key for the certificate

        @type pkey:  EVP_PKEY
        @param pkey: Public key
        N(Rtx509_set_pubkeyRRtpkey(RR((Rt
set_pubkeyscCstti|iS(N(RORtx509_get_issuer_nameRR(R((Rt
get_issuerscCsti|i|iS(sp
        Set issuer name.

        @type name:     X509_Name
        @param name:    subjectName field.
        N(RRRRR
Rc(RR
((Rt
set_issuerscCstti|iS(N(RORtx509_get_subject_nameRR(R((Rtget_subjectscCsti|i|iS(sq
        Set subject name.

        @type name:     X509_Name
        @param name:    subjectName field.
        N(RRRRR
Rc(RR
((Rtset_subjectscCsti|i|idS(s
        Add X509 extension to this certificate.

        @type ext:     X509_Extension
        @param ext:    Extension
        iN(Rtx509_add_extRRtextR(RR((Rtadd_extscCsQxDt|iD]0}|i|}|i|jo|SqqWtdS(s
        Get X509 extension by name.

        @type name:    Name of the extension
        @param name:   str
        @return:       X509_Extension
        N(	R,Rt
get_ext_countR-t
get_ext_atRRR
tLookupError(RR
R-R((Rtget_extscCsI|djp||ijo
tntti|i|ddS(s
        Get X509 extension by index.

        @type index:    Name of the extension
        @param index:   int
        @return:        X509_Extension
        iRN(tindexRRRrR
Rtx509_get_extR(RR((RRs
 
cCsti|iS(s+
        Get X509 extension count.
        N(Rtx509_get_ext_countRR(R((RRscCsNtt|d}|djotd|fnti|i|i	|S(s
        Sign the certificate.

        @type pkey:  EVP_PKEY
        @param pkey: Public key
        @type md:    str
        @param md:   Message digest algorithm to use for signing,
                     for example 'sha1'.
        sunknown message digestN(
RRtmdR'tmdat
ValueErrort	x509_signRRR(RRRR((Rtsigns	
cCsD|oti|i|iSn ti|iti|iSdS(N(RRtx509_verifyRRR(RR((RtverifyscCsti|iS(s
        Check if the certificate is a Certificate Authority (CA) certificate.
        
        @return: 0 if the certificate is not CA, nonzero otherwise.
        
        @requires: OpenSSL 0.9.8 or newer 
        N(Rt
x509_check_caRR(R((Rtcheck_cascCsti|i||S(s)
        Check if the certificate's purpose matches the asked purpose.
        
        @param id: Purpose id. See X509_PURPOSE_* constants.
        @param ca: 1 if the certificate should be CA, 0 otherwise.
        @return: 0 if the certificate purpose does not match, nonzero otherwise.
        N(Rtx509_check_purposeRRtidtca(RRR((Rt
check_purpose
s(&RRR%Rt	x509_freeRR'RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR(((RR'sB																				
		
		
	
					
cCsti|}t|S(s
    Load certificate from file.

    @type file: string
    @param file: Name of file containing certificate in PEM format.

    @rtype: M2Crypto.X509.X509
    @return: M2Crypto.X509.X509 object.
    N(RRtfileRt
load_cert_bio(RR((Rt	load_certs	cCstti|idS(Ni(RRt
x509_read_pemRR(R((RR&scCsti|}t|S(N(RRtstringRR(RR((Rtload_cert_string*stX509_Store_ContextcBsPtZdZeiZddZdZdZdZ	dZ
dZRS(s
    X509 Store Context
    icCs||_||_dS(N(tx509_store_ctxRRR(RRR((RR6s	cCs"|io|i|indS(N(RRtm2_x509_store_ctx_freeR(R((RR:s
cCs|iS(N(RR(R((RR>scCstti|iddS(s
        Get current X.509 certificate.
        
        @warning: The returned certificate is NOT refcounted, so you can not
        rely on it being valid once the store context goes away or is modified.
        RiN(RRtx509_store_ctx_get_current_certRR(R((Rtget_current_certAscCsti|iS(s!
        Get error code.
        N(Rtx509_store_ctx_get_errorRR(R((Rt	get_errorJscCsti|iS(s"
        Get error depth.
        N(Rtx509_store_ctx_get_error_depthRR(R((Rtget_error_depthPs(RRR%Rtx509_store_ctx_freeRRRRRRR(((RR/s						t
X509_StorecBsVtZdZeiZeddZdZdZ	dZ
e
ZdZeZ
RS(s
    X509 Store
    icCs?|dj	o||_||_nti|_d|_dS(Ni(tstoreR'RRRtx509_store_new(RRR((RR^s

	
cCs+t|ddo|i|indS(NRi(RRtm2_x509_store_freeR(R((RRfscCs|iS(N(RR(R((RRjscCsti|i|dS(N(Rtx509_store_load_locationsRRR(RR((Rt	load_infomscCsti|i|iS(N(Rtx509_store_add_certRRRR(RR((Rtadd_x509rs(RRR%Rtx509_store_freeRR'RRRRtload_locationsRtadd_cert(((RRWs					t
X509_StackcBsntZdZeiZeddZdZdZ	dZ
dZdZdZ
d	Zd
ZRS(sL
    X509 Stack

    @warning: Do not modify the underlying OpenSSL stack
    except through this interface, or use any OpenSSL functions that do so
    indirectly. Doing so will get the OpenSSL stack and the internal pystack
    of this class out of sync, leading to python memory leaks, exceptions
    or even python crashes!
    icCs|dj	os||_||_g|_ti|i}xdt|D]1}|ii
tti|i|d|qGWn"ti
|_d|_g|_dS(NRi(R)R'RRR.Rtsk_x509_numR+R,R-R/Rt
sk_x509_valuetsk_x509_new_null(RR)RR-R+((RRs
			
	cCs+t|ddo|i|indS(NRi(RRtm2_sk_x509_freeR)(R((RRscCs
t|iS(N(R3RR.(R((RR4scCs|i|S(N(RR.R5(RR5((RR6scCs
t|iS(N(R7RR.(R((RR8scCs|iS(N(RR)(R((RRscCs/|ii|ti|i|i}|S(s
        push an X509 certificate onto the stack.
        
        @param x509: X509 object.
        @return: The number of X509 objects currently on the stack.
        N(	RR.R/RRtsk_x509_pushR)RR:(RRR:((RR;scCs4ti|i}|djodSn|iiS(s
        pop a certificate from the stack.
        
        @return: X509 object that was popped, or None if there is nothing
        to pop. 
        N(Rtsk_x509_popRR)tx509_ptrR'R.R=(RR((RR=s
cCsti|iS(s:
        Return the stack as a DER encoded string
        N(Rtget_der_encoding_stackRR)(R((RRs(RRR%Rtsk_x509_freeRR'RRR4R6R8RR;R=R(((RRys								
	
cCsti|}t|dS(sO
    Create a new X509_Stack from DER string.
    
    @return: X509_Stack
    iN(Rtmake_stack_from_der_sequencet
der_stringt	stack_ptrR(RR((Rtnew_stack_from_derstRequestcBstZdZeiZeddZdZdZ	dZ
dZdZdZ
d	Zd
ZdZdZd
ZdZdZRS(s#
    X509 Certificate Request.
    icCs?|dj	o||_||_nti|_d|_dS(Ni(treqR'RRRtx509_req_new(RRR((RRs

	
cCs+t|ddo|i|indS(NRi(RRtm2_x509_req_freeR(R((RRscCs/ti}ti|i|i|iS(N(	RRR Rtx509_req_printR"RRR#(RR ((RRscCs/ti}ti|i|i|iS(N(	RRR Rtx509_req_write_pemR"RRR#(RR ((RRscCs+ti|d}ti|i|iS(NR(	RRRRRRR"RR(RRR((RRscCstiti|iddS(s
        Get the public key for the request.

        @rtype:      EVP_PKEY
        @return:     Public key from the request.
        RiN(RRRtx509_req_get_pubkeyRR(R((RRscCsti|i|iS(s
        Set the public key for the request.

        @type pkey:  EVP_PKEY
        @param pkey: Public key

        @rtype:      int
        @return:     Return 1 for success and 0 for failure.
        N(Rtx509_req_set_pubkeyRRR(RR((RRs	cCsti|iS(sd
        Get version.

        @rtype:         int
        @return:        Returns version.
        N(Rtx509_req_get_versionRR(R((RRscCsti|i|S(s
        Set version.

        @type version:  int
        @param version: Version number.
        @rtype:         int
        @return:        Returns 0 on failure.
        N(Rtx509_req_set_versionRRR(RR((RRscCstti|iS(N(RORtx509_req_get_subject_nameRR(R((RRscCsti|i|iS(sq
        Set subject name.

        @type name:     X509_Name
        @param name:    subjectName field.
        N(Rtx509_req_set_subject_nameRRR
Rc(RR
((RRscCsti|i|iS(s
        Add X509 extensions to this request.

        @type ext_stack:  X509_Extension_Stack
        @param ext_stack: Stack of extensions to add.
        N(Rtx509_req_add_extensionsRRt	ext_stackR(RR((Rtadd_extensions&scCsti|i|iS(N(Rtx509_req_verifyRRR(RR((RR/scCsNtt|d}|djotd|fnti|i|i	|S(Nsunknown message digest(
RRRR'RRt
x509_req_signRRR(RRRR((RR2s
(RRR%Rt
x509_req_freeRR'RRRRRRRRRRRRRR(((RRs 																	cCsXti|}ti|i}|i|djot
int|dS(s
    Load certificate request from file.

    @type file: string
    @param file: Name of file containing certificate request in PEM format.

    @rtype: M2Crypto.X509.Request
    @return: M2Crypto.X509.Request object.
    iN(
RRRtfRtx509_req_read_pemR"tcptrtcloseR'tErrRR(RRR((Rtload_request9s	

tCRLcBs8tZdZeiZeddZdZdZ	RS(s*
    X509 Certificate Revocation List
    icCs?|dj	o||_||_nti|_d|_dS(Ni(tcrlR'RRRtx509_crl_new(RRR((RRRs

	
cCs+t|ddo|i|indS(NRi(RRtm2_x509_crl_freeR(R((RRZscCs/ti}ti|i|i|iS(s
        Return CRL in PEM format in a string.

        @rtype: string
        @return: String containing the CRL in PEM format.
        N(	RRR Rtx509_crl_printR"RRR#(RR ((RR^s(
RRR%Rt
x509_crl_freeRR'RRR(((RRKs
		cCsXti|}ti|i}|i|djot
int|dS(s
    Load CRL from file.

    @type file: string
    @param file: Name of file containing CRL in PEM format.

    @rtype: M2Crypto.X509.CRL
    @return: M2Crypto.X509.CRL object.
    iN(
RRRRRtx509_crl_read_pemR"RRR'RRR(RRR((Rtload_crljs	

(R%tM2CryptoRERRRRt	ExceptionRt	x509_initt	X509_V_OKtV_OKRR
R(R?RORRRRRRRRRRRR"(RR'RRER"RRRRRRRRRR?R(RRRRRRORR
((Rt?s,	
	6Eq			("M	
i	

Anon7 - 2021