
    i`                     T    d dl Z d dlmZmZmZ d dlmZ  G d de j                  ZdS )    N)b2hh2bHexstr)ResTuplec                   z    e Zd Zej        dedefd            Zej        dededefd            Zdede	de
fd	Zd
S )SecureChannelapdureturnc                     dS )z@Wrap Command APDU according to specific Secure Channel Protocol.N )selfr	   s     B/home/jenkins/workspace/simtester-sanitize/pySim/secure_channel.pywrap_cmd_apduzSecureChannel.wrap_cmd_apdu   	     	    swrsp_apduc                     dS )zCUnWrap Response-APDU according to specific Secure Channel Protocol.Nr   )r   r   r   s      r   unwrap_rsp_apduzSecureChannel.unwrap_rsp_apdu   r   r   send_fnpduc                     t          |                     t          |                              } ||g|R i |\  }}t          |                     t          |          t          |                              }||fS )zYWrapper function to wrap command APDU and unwrap response APDU around send_apdu callable.)r   r   r   r   )	r   r   r   argskwargspdu_wrappedresr   res_unwrappeds	            r   send_apdu_wrapperzSecureChannel.send_apdu_wrapper"   sz    $,,SXX6677'+777777RD00R#c((CCDDb  r   N)__name__
__module____qualname__abcabstractmethodbytesr   r   callabler   r   r   r   r   r   r   r      s        % E     	% 5 U    ! ! !T\ ! ! ! ! ! !r   r   )	r"   osmocom.utilsr   r   r   pySim.utilsr   ABCr   r   r   r   <module>r)      sv   $ 


 * * * * * * * * * *            ! ! ! ! !CG ! ! ! ! !r   