404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.148.105.152: ~ $
3

�}:a�2�@s�dZddlZddlZddlmZmZmZmZejd�Z	ej
d�Zej
d�Zej
d�Zej
d�Zej
d	�ZGd
d�dej�ZGdd
�d
�ZGdd�deje�ZGdd�deje�ZGdd�deje�Zedkr�ej�dS)zTests for josepy.jwk.�N)�errors�	json_util�	test_util�utilzdsa512_key.pemzrsa256_key.pemzrsa512_key.pemzec_p256_key.pemzec_p384_key.pemzec_p521_key.pemc@s eZdZdZdd�Zdd�ZdS)�JWKTestzTests for josepy.jwk.JWK.cCs"ddlm}|jtj|jt�dS)Nr)�JWK)�
josepy.jwkr�assertRaisesr�Error�load�DSA_PEM)�selfr�r�/usr/lib/python3.6/jwk_test.py�	test_loadszJWKTest.test_loadcCs"ddlm}|jtj|jt�dS)Nr)�JWKRSA)rrr	rr
rr)r
rrrr�test_load_subclass_wrong_typesz%JWKTest.test_load_subclass_wrong_typeN)�__name__�
__module__�__qualname__�__doc__rrrrrrrsrc@s*eZdZUdZeZedd�Zdd�ZdS)�JWKTestBaseMixinz"Mixin test for JWK subclass tests.cCs|j|j|jj��dS)N)�assertEqual�
thumbprint�jwk)r
rrr�test_thumbprint_private sz(JWKTestBaseMixin.test_thumbprint_privatecCs|j|j|jj�j��dS)N)rrr�
public_key)r
rrr�test_thumbprint_public#sz'JWKTestBaseMixin.test_thumbprint_publicN)	rrrr�NotImplementedr�bytesrrrrrrrs
rc@sDeZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dS)�
JWKOctTestzTests for josepy.jwk.JWKOct.s �羨`��p�}��>�I�͒'�o�1�(��icCs.ddlm}|dd�|_dtjd�d�|_dS)Nr)�JWKOctsfoo)�key�oct)�kty�k)rr!rrZencode_b64jose�jobj)r
r!rrr�setUp.szJWKOctTest.setUpcCs|j|jj�|j�dS)N)rr�to_partial_jsonr&)r
rrr�test_to_partial_json3szJWKOctTest.test_to_partial_jsoncCs&ddlm}|j|j|j|j��dS)Nr)r!)rr!rr�	from_jsonr&)r
r!rrr�test_from_json6szJWKOctTest.test_from_jsoncCs ddlm}t|j|j��dS)Nr)r!)rr!�hashr*r&)r
r!rrr�test_from_json_hashable:sz"JWKOctTest.test_from_json_hashablecCs$ddlm}|j|j|jd��dS)Nr)r!sfoo)rr!rrr)r
r!rrrr>szJWKOctTest.test_loadcCs|j|jj�|j�dS)N)ZassertIsrr)r
rrr�test_public_keyBszJWKOctTest.test_public_keyN)rrrrrr'r)r+r-rr.rrrrr 'sr c@s�eZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�ZdS) �
JWKRSATestzTests for josepy.jwk.JWKRSA.s �K�#3�ʘ�ˀ�<�H�*l�$�&|O�� �YcCs�ddlm}|tj�d�|_dddd�|_|tj�jd�|_|tj�d�|_	dddd�|_
|td�|_|jj�|_
d	|j
d
<|jj�|_|jjd	ddd
ddd��|j|_dS)Nr)r)r"�RSA�AQABz+m2Fylv-Uz7trgTW8EBHP3FQSMeZs2GNQ6VRo1sIVJEk)r$�e�nzVrHVztFHtH92ucFJD_N_HW9AsdRsUuHUBBBDlHwNlRd3fp580rv2-6QWE30cWgdmJS86ObRz6lUTor4R0T-3C5Qz+lPQED_EPTV0UIBfNI3KP2d9Jlrc2mrMllmf946bu-CE�dZzUVNZn4lLLBD1R6NE8TKNQZwcfKfc7kl5jfqXArCRSURQZCWJFq43QvT5Bm5iN8n1okQZbHh2u7etM8LKKCF2pY2UdQZoi45cEkbVoJjAbnQpFY87Q)r4�p�qZdpZdqZqi)rr�
RSA256_KEYr�jwk256�
jwk256json�_wrapped�jwk256_not_comparable�
RSA512_KEY�jwk512�
jwk512json�private�copy�private_json_small�private_json�updater)r
rrrrr'Ms.



zJWKRSATest.setUpcCs&|j|jjtj�|j|j|j�dS)N)�assertIsInstancer;r"rZComparableRSAKeyrr8)r
rrr�test_init_auto_comparablensz$JWKRSATest.test_init_auto_comparablecCs"ddlm}|jd|jd��dS)Nr)r�AA)rrr�
_encode_param)r
rrrr�test_encode_param_zerorsz!JWKRSATest.test_encode_param_zerocCs$|j|j|j�|j|j|j�dS)N)rr8r=)r
rrr�test_equalsxszJWKRSATest.test_equalscCs$|j|j|j�|j|j|j�dS)N)�assertNotEqualr8r=)r
rrr�test_not_equals|szJWKRSATest.test_not_equalscCs*ddlm}|j|j|jtjd���dS)Nr)rzrsa256_key.pem)rrrr?rr�load_vector)r
rrrrr�szJWKRSATest.test_loadcCs|j|j|jj��dS)N)rr8r?r)r
rrrr.�szJWKRSATest.test_public_keycCs@|j|jj�|j�|j|jj�|j�|j|jj�|j�dS)N)rr8r(r9r=r>r?rB)r
rrrr)�szJWKRSATest.test_to_partial_jsoncCsRddlm}|j|j|j|j��|j|j|j|j��|j|j|j|j	��dS)Nr)r)
rrrr8r*r9r=r>r?rB)r
rrrrr+�szJWKRSATest.test_from_jsoncCs&ddlm}|j|j|j|j��dS)Nr)r)rrrr?r*rA)r
rrrr�test_from_json_private_small�sz'JWKRSATest.test_from_json_private_smallcCs,ddlm}|jd=|jtj|j|j�dS)Nr)rr6)rrrBr	rr
r*)r
rrrr�%test_from_json_missing_one_additional�sz0JWKRSATest.test_from_json_missing_one_additionalcCs ddlm}t|j|j��dS)Nr)r)rrr,r*r9)r
rrrrr-�sz"JWKRSATest.test_from_json_hashablecCsDddlm}|jtj|jdddd��|jtj|jdddd��dS)Nr)rr0r1�)r$r2r3�1)rrr	r�DeserializationErrorr*)r
rrrr� test_from_json_non_schema_errors�s
z+JWKRSATest.test_from_json_non_schema_errorscCs0ddlm}|jd�}|jtj|j��d�dS)Nr)ra�{
    "kty": "RSA",
    "kid": "bilbo.baggins@hobbiton.example",
    "use": "sig",
    "n": "n4EPtAOCc9AlkeQHPzHStgAbgs7bTZLwUBZdR8_KuKPEHLd4rHVTeT-O-XV2jRojdNhxJWTDvNd7nqQ0VEiZQHz_AJmSCpMaJMRBSFKrKb2wqVwGU_NsYOYL-QtiWN2lbzcEe6XC0dApr5ydQLrHqkHHig3RBordaZ6Aj-oBHqFEHYpPe7Tpe-OfVfHd1E6cS6M1FZcD1NNLYD5lFHpPI9bTwJlsde3uhGqC0ZCuEHg8lhzwOHrtIQbS0FVbb9k3-tVTU4fg_3L_vniUFAKwuCLqKnS2BYwdq_mzSnbLY7h_qixoR7jig3__kRhuaxwUkRz5iaiQkqgc5gHdrNP5zw",
    "e": "AQAB"
}s@f63838e96077ad1fc01c3f8405774dedc0641f558ebb4b40dccf5f9b6d66a932)rrZ
json_loadsr�binasciiZhexlifyr)r
rr"rrr�test_thumbprint_go_jose�sz"JWKRSATest.test_thumbprint_go_joseN)rrrrrr'rErHrIrKrr.r)r+rMrNr-rRrTrrrrr/Fs !r/c@s�eZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!S)"�	JWKECTestzTests for josepy.jwk.JWKEC.s �L���lF�J��$	�j�Od�R�������cCs�ddlm}|tj�d�|_|tj�d�|_|tj�d�|_|tj�j	d�|_
ddddd�|_dd	d
dd�|_ddd
dd�|_
|td�|_dddddd�|_|j|_dS)Nr)�JWKEC)r"�ECzP-256z+jjQtV-fA7J_tK8dPzYq7jRPNjF8r5p6LW2R25S2Gw5Uz+EPAw8_8z7PYKsHH6hlGSlsWxFoFl7-0vM0QRGbmnvCc)r$�crv�x�yzP-384Z@tIhpNtEXkadUbrY84rYGgApFM1X_3l3EWQRuOP1IWtxlTftrZQwneJZF0k0eRn00z@KW2Gp-TThDXmZ-9MJPnD8hv-X130SVvfZRl1a04HPVwIbvLe87mvA_iuOa-myUyvzP-521ZXAFkdl6cKzBmP18U8fffpP4IZN2eED45hDcwRPl5ZeClwHcLtnMBMuWYFFO_Nzm6DL2MhpN0zI2bcMLJd95aY2tPszXAYvZq3wByjt7nQd8nYMqhFNCL3j_-U6GPWZet1hYBY_XZHrC4yIV0R4JnssRAY9eqc1EElpCc4hziis1jiV1iR4WZ+xReNQBKqqTthG8oTmBdhp4EQYImSK1dVqfa2yyMn2rc)r4rYrZrXr$)rrV�EC_P256_KEYrr8�EC_P384_KEY�jwk384�EC_P521_KEY�jwk521r:r;r9�
jwk384json�
jwk521jsonr?rBr)r
rVrrrr'�s0



zJWKECTest.setUpcCs&|j|jjtj�|j|j|j�dS)N)rDr;r"rZComparableECKeyrr8)r
rrrrE�sz#JWKECTest.test_init_auto_comparablecCs$ddlm}|jd|jdd��dS)Nr)rVrF�)rrVrrG)r
rVrrrrH�sz JWKECTest.test_encode_param_zerocCs4|j|j|j�|j|j|j�|j|j|j�dS)N)rr8r]r_)r
rrrrI�szJWKECTest.test_equalscCsd|j|j|j�|j|j|j�|j|j|j�|j|j|j�|j|j|j�|j|j|j�dS)N)rJr8r]r_)r
rrrrK�szJWKECTest.test_not_equalscCs*ddlm}|j|j|jtjd���dS)Nr)rVzec_p256_key.pem)rrVrr?rrrL)r
rVrrrr�szJWKECTest.test_loadcCs|j|j|jj��dS)N)rr8r?r)r
rrrr.szJWKECTest.test_public_keycCsT|j|jj�|j�|j|jj�|j�|j|jj�|j�|j|jj�|j	�dS)N)
rr8r(r9r]r`r_rar?rB)r
rrrr)szJWKECTest.test_to_partial_jsoncCshddlm}|j|j|j|j��|j|j|j|j��|j|j|j|j	��|j|j
|j|j��dS)Nr)r)rrrr8r*r9r]r`r_rar?rB)r
rrrrr+	szJWKECTest.test_from_jsoncCs*ddlm}|jd=|jt|j|j�dS)Nr)rrY)rrrBr	�KeyErrorr*)r
rrrr�#test_from_json_missing_x_coordinatesz-JWKECTest.test_from_json_missing_x_coordinatecCs*ddlm}|jd=|jt|j|j�dS)Nr)rrZ)rrrBr	rcr*)r
rrrr�#test_from_json_missing_y_coordinatesz-JWKECTest.test_from_json_missing_y_coordinatecCs ddlm}t|j|j��dS)Nr)r)rrr,r*r9)r
rrrrr-sz!JWKECTest.test_from_json_hashablecCsHddlm}|jtj|jddddd��|jtj|jdddd	d��dS)
Nr)rrWzP-256r1z+m2Fylv-Uz7trgTW8EBHP3FQSMeZs2GNQ6VRo1sIVJEk)r$rXrYrZz+jjQtV-fA7J_tK8dPzYq7jRPNjF8r5p6LW2R25S2Gw5UrP)rrr	rrQr*)r
rrrrrR"s
z*JWKECTest.test_from_json_non_schema_errorscCs,ddlm}|jtj|jddddd��dS)Nr)rrWzP-255z+jjQtV-fA7J_tK8dPzYq7jRPNjF8r5p6LW2R25S2Gw5Uz+EPAw8_8z7PYKsHH6hlGSlsWxFoFl7-0vM0QRGbmnvCc)r$rXrYrZ)rrr	rrQr*)r
rrrr�test_unknown_crv_name+szJWKECTest.test_unknown_crv_namecCslddlm}m}ddl}d}|j|�}|j�}|jj|d�}|j|dd�|jt	|�d�|j
|�dS)Nr)rVrs�-----BEGIN EC PRIVATE KEY-----
MHcCAQEEICZ7LCI99Na2KZ/Fq8JmJROakGJ5+J7rHiGSPoO36kOAoAoGCCqGSM49
AwEHoUQDQgAEGS5RvStca15z2FEanCM3juoX7tE/LB7iD44GWawGE40APAl/iZuH
31wQfst4glTZpxkpEI/MzNZHjiYnqrGeSw==
-----END EC PRIVATE KEY-----rZ� )rrVr�josepyrr(rZdecode_b64joser�lenr*)r
rVrrh�datar"rZrrr�test_encode_y_leading_zero_p2563s
z)JWKECTest.test_encode_y_leading_zero_p256N)rrrrrr'rErHrIrKrr.r)r+rdrer-rRrfrkrrrrrU�s"!	rU�__main__)rrSZunittestrhrrrrrLrZload_rsa_private_keyr7r<Zload_ec_private_keyr[r\r^ZTestCaserrr r/rUr�mainrrrr�<module>s"





u	

Filemanager

Name Type Size Permission Actions
__init__.cpython-36.opt-1.pyc File 1.95 KB 0644
__init__.cpython-36.pyc File 1.95 KB 0644
b64.cpython-36.opt-1.pyc File 1.56 KB 0644
b64.cpython-36.pyc File 1.56 KB 0644
b64_test.cpython-36.opt-1.pyc File 3.47 KB 0644
b64_test.cpython-36.pyc File 3.47 KB 0644
errors.cpython-36.opt-1.pyc File 1.55 KB 0644
errors.cpython-36.pyc File 1.55 KB 0644
errors_test.cpython-36.opt-1.pyc File 854 B 0644
errors_test.cpython-36.pyc File 854 B 0644
interfaces.cpython-36.opt-1.pyc File 7.93 KB 0644
interfaces.cpython-36.pyc File 7.93 KB 0644
interfaces_test.cpython-36.opt-1.pyc File 5.38 KB 0644
interfaces_test.cpython-36.pyc File 5.38 KB 0644
json_util.cpython-36.opt-1.pyc File 14.93 KB 0644
json_util.cpython-36.pyc File 14.93 KB 0644
json_util_test.cpython-36.opt-1.pyc File 17.19 KB 0644
json_util_test.cpython-36.pyc File 17.19 KB 0644
jwa.cpython-36.opt-1.pyc File 7.73 KB 0644
jwa.cpython-36.pyc File 7.73 KB 0644
jwa_test.cpython-36.opt-1.pyc File 9.67 KB 0644
jwa_test.cpython-36.pyc File 9.67 KB 0644
jwk.cpython-36.opt-1.pyc File 11.66 KB 0644
jwk.cpython-36.pyc File 11.66 KB 0644
jwk_test.cpython-36.opt-1.pyc File 12.73 KB 0644
jwk_test.cpython-36.pyc File 12.73 KB 0644
jws.cpython-36.opt-1.pyc File 12.1 KB 0644
jws.cpython-36.pyc File 12.49 KB 0644
jws_test.cpython-36.opt-1.pyc File 9.4 KB 0644
jws_test.cpython-36.pyc File 9.4 KB 0644
magic_typing.cpython-36.opt-1.pyc File 775 B 0644
magic_typing.cpython-36.pyc File 775 B 0644
magic_typing_test.cpython-36.opt-1.pyc File 1.07 KB 0644
magic_typing_test.cpython-36.pyc File 1.07 KB 0644
test_util.cpython-36.opt-1.pyc File 2.77 KB 0644
test_util.cpython-36.pyc File 2.77 KB 0644
util.cpython-36.opt-1.pyc File 9.76 KB 0644
util.cpython-36.pyc File 9.84 KB 0644
util_test.cpython-36.opt-1.pyc File 11.62 KB 0644
util_test.cpython-36.pyc File 11.62 KB 0644