
    Bfi                        d Z dZdZdZdZdZdZ	 ddlmZm	Z	m
Z
mZmZ dZ G d dej(                        Z G d de      Z G d dej.                        Z G d dej2                        Z G d dej6                        Z G d dej:                        Z G d dej(                        Z G d dej2                        Z  G d dej:                        Z! G d  d!ej2                        Z" G d" d#ej(                        Z# G d$ d%ej:                        Z$ G d& d'e$      Z%y
# e$ r3Zd	ez  Zdd
lZ ej"                  e        G d de      Z ee      d
Z[ww xY w)(zNDG HTTPS Client package

Use pyasn1 to provide support for parsing ASN.1 formatted subjectAltName
content for SSL peer verification.  Code based on:

http://stackoverflow.com/questions/5519958/how-do-i-parse-subjectaltname-extension-data-using-pyasn1
zP J Kershawz01/02/12z2(C) 2012 Science and Technology Facilities Councilz-BSD - see LICENSE file in top-level directoryzPhilip.Kershaw@stfc.ac.ukz$Id$    )univ
constraintchar	namedtypetagzmError importing pyasn1, subjectAltName check for SSL peer verification will be disabled.  Import error is: %sNc                       e Zd ZdZy)Pyasn1ImportErrorzRaise for pyasn1 import errorN__name__
__module____qualname____doc__     o/var/www/html/BankruptcyAI-uat/bankruptcy-ai/venv/lib/python3.12/site-packages/ndg/httpsclient/subj_alt_name.pyr	   r	      s    'r   r	   i   c                   J   e Zd ZdZ ej
                   ej                  d ej                         j                   e
j                  de                   ej                  d ej                         j                   e
j                  de                   ej                  d ej                         j                   e
j                  de                   ej                  d ej                         j                   e
j                  de                   ej                  d ej                          j                   e
j                  de                   ej                  d	 ej"                         j                   e
j                  de                        Zy
)DirectoryStringzASN.1 Directory string classteletexString   )subtypeSpecprintableStringuniversalString
utf8String	bmpString	ia5StringN)r   r   r   r   r   
NamedTypes	NamedTyper   TeletexStringsubtyper   ValueSizeConstraintMAXPrintableStringUniversalString
UTF8String	BMPString	IA5StringcomponentTyper   r   r   r   r      s   &(I((	/T//199:J::1cB : D	E 		3t335==:J::1cB  >  D	E 		3t335==:J::1cB  >  D	E 		/$//+33:J::1cB 4 D	E 		)11:J::1cB 2 D	E 		)11:J::1cB 2 D	E!
Mr   r   c                       e Zd ZdZy)AttributeValuezASN.1 Attribute valueNr
   r   r   r   r)   r)   7   s    r   r)   c                       e Zd ZdZy)AttributeTypezASN.1 Attribute typeNr
   r   r   r   r+   r+   ;   s    r   r+   c                       e Zd ZdZ ej
                   ej                  d e              ej                  d e                   Z	y)AttributeTypeAndValuez$ASN.1 Attribute type and value classtypevalueN)
r   r   r   r   r   r   r   r+   r)   r'   r   r   r   r-   r-   ?   s@    .(I((	FMO4	G^%56
Mr   r-   c                       e Zd ZdZ e       Zy)RelativeDistinguishedNamez!ASN.1 Realtive distinguished nameN)r   r   r   r   r-   r'   r   r   r   r1   r1   G   s    +)+Mr   r1   c                       e Zd ZdZ e       Zy)RDNSequencezASN.1 RDN sequence classN)r   r   r   r   r1   r'   r   r   r   r3   r3   K   s    "-/Mr   r3   c                   `    e Zd ZdZ ej
                   ej                  d e                   Zy)NamezASN.1 name class N)	r   r   r   r   r   r   r   r3   r'   r   r   r   r5   r5   P   s+    (I((	B.
Mr   r5   c            	           e Zd ZdZ ej
                   ej                  d ej                                ej                  d ej                  d             ej                  d ej                                     Zy)	ExtensionzASN.1 extension classextnIDcriticalFalse	extnValueN)r   r   r   r   r   r   r   r   ObjectIdentifierDefaultedNamedTypeBooleanOctetStringr'   r   r   r   r8   r8   W   sp    (I((	H&;d&;&;&=>$	$$Zg1FG	K)9)9)9);<
Mr   r8   c                   r    e Zd ZdZ e       Zej                  j                   e	j                  de      z   Zy)
ExtensionszASN.1 extensions classr   N)r   r   r   r   r8   r'   r   
SequenceOfsizeSpecr   r    r!   r   r   r   rB   rB   `   s0     KM''*H**H*HC*PPHr   rB   c                      e Zd Z ej                   ej
                  d ej                                ej
                  d ej                         j                   e
j                  e
j                  e
j                  d                        Zy)AnotherNameztype-idr/   r   )explicitTagN)r   r   r   r   r   r   r   r=   Anyr   r   TagtagClassContexttagFormatSimpler'   r   r   r   rF   rF   f   s    (I((	I'<t'<'<'>?	GXTXXZ%7%7(/0C0C030C0CQ)H &8 &I 	J
Mr   rF   c                      e Zd ZdZ ej
                   ej                  d e       j                   e	j                  e	j                  e	j                  d                   ej                  d ej                         j                   e	j                  e	j                  e	j                  d                   ej                  d ej                         j                   e	j                  e	j                  e	j                  d                   ej                  d	 e       j                   e	j                  e	j                  e	j                  d
                   ej                  d ej                         j                   e	j                  e	j                  e	j                  d                   ej                  d ej"                         j                   e	j                  e	j                  e	j                  d                   ej                  d ej$                         j                   e	j                  e	j                  e	j                  d                        Zy)GeneralNamez@ASN.1 configuration for X.509 certificate subjectAltNames fields	otherNamer   )implicitTag
rfc822Namer   dNSName   directoryName   uniformResourceIdentifier   	iPAddress   registeredID   N)r   r   r   r   r   r   r   rF   r   r   rI   rJ   rK   r   r&   r5   r   r@   r=   r'   r   r   r   rM   rM   o   sV   J(I((	K)>)>(/0C0C030C0CQ)H *? *I 	J 		L.$..*:*B*B(/0C0C030C0CQ)H +C +I 	J 		I~t~~'7'?'?(/0C0C030C0CQ)H (@ (I 	J 		OTV^^(/0C0C030C0CQ)H .< .I 	J 		79I9Q9Q(/0C0C030C0CQ)H :R :I 	J 		K)9)9)9);)C)C(/0C0C030C0CQ)H *D *I 	J 		N,AD,A,A,C,K,K(/0C0C030C0CQ)H -L -I 	J3
Mr   rM   c                   r    e Zd ZdZ e       Zej                  j                   e	j                  de      z   Zy)GeneralNamesz4Sequence of names for ASN.1 subjectAltNames settingsr   N)r   r   r   r   rM   r'   r   rC   rD   r   r    r!   r   r   r   r\   r\      s0    >MM''*H**H*HC*PPHr   r\   c                       e Zd ZdZy)SubjectAltNamez0ASN.1 implementation for subjectAltNames supportNr
   r   r   r   r^   r^      s    :r   r^   )&r   
__author____date____copyright____license____contact____revision__pyasn1.typer   r   r   r   r   ImportErroreimport_error_msgwarningswarnr	   r!   Choicer   r)   r=   r+   Sequencer-   SetOfr1   rC   r3   r5   r8   rB   rF   rM   r\   r^   r   r   r   <module>rn      sZ   
D=).BB 
dkk 
0 _  D)) 
DMM 
,

 ,0$// 0

4;; 

 
Q Q
$-- 

$++ 
BQ4?? Q;\ ;K  .!#$% HMM"#(K (
,
--.s   D E#.EE