
    \Ah                     >    S SK JrJr   " S S5      r " S S\5      rg)   )base64url_encodeensure_binaryc                   \    \ rS rSrSrS rS rS rS rS r	S r
SS
 jrSS jrS rS rSrg	)Key   z/
A simple interface for implementing JWK keys.
c                     g N )selfkey	algorithms      YC:\Users\julio\Documents\inmobiliaria_backend\env\Lib\site-packages\jose/backends/base.py__init__Key.__init__	   s        c                     [        5       er	   NotImplementedError)r   msgs     r   signKey.sign       !##r   c                     [        5       er	   r   )r   r   sigs      r   verify
Key.verify   r   r   c                     [        5       er	   r   r   s    r   
public_keyKey.public_key   r   r   c                     [        5       er	   r   r   s    r   to_pem
Key.to_pem   r   r   c                     [        5       er	   r   r   s    r   to_dictKey.to_dict   r   r   Nc                     [        5       e)a  
Encrypt the plain text and generate an auth tag if appropriate

Args:
    plain_text (bytes): Data to encrypt
    aad (bytes, optional): Authenticated Additional Data if key's algorithm supports auth mode

Returns:
    (bytes, bytes, bytes): IV, cipher text, and auth tag
r   )r   
plain_textaads      r   encryptKey.encrypt   s     "##r   c                     [        5       e)a1  
Decrypt the cipher text and validate the auth tag if present
Args:
    cipher_text (bytes): Cipher text to decrypt
    iv (bytes): IV if block mode
    aad (bytes): Additional Authenticated Data to verify if auth mode
    tag (bytes): Authentication tag if auth mode

Returns:
    bytes: Decrypted value
r   )r   cipher_textivr)   tags        r   decryptKey.decrypt(   s     "##r   c                     [        5       e)zq
Wrap the the plain text key data

Args:
    key_data (bytes): Key data to wrap

Returns:
    bytes: Wrapped key
r   )r   key_datas     r   wrap_keyKey.wrap_key6        "##r   c                     [        5       e)z
Unwrap the the wrapped key data

Args:
    wrapped_key (bytes): Wrapped key data to unwrap

Returns:
    bytes: Unwrapped key
r   )r   wrapped_keys     r   
unwrap_keyKey.unwrap_keyB   r6   r   r
   r	   )NNN)__name__
__module____qualname____firstlineno____doc__r   r   r   r   r"   r%   r*   r0   r4   r9   __static_attributes__r
   r   r   r   r      s9    $$$$$$$
$
$r   r   c                        \ rS rSrS rS rSrg)DIRKeyO   c                 0    [        U5      U l        X l        g r	   )r   _key_alg)r   r3   r   s      r   r   DIRKey.__init__P   s    !(+		r   c                 H    U R                   S[        U R                  5      S.$ )Noct)algktyk)rF   r   rE   r   s    r   r%   DIRKey.to_dictT   s"    99!$)),
 	
r   )rF   rE   N)r;   r<   r=   r>   r   r%   r@   r
   r   r   rB   rB   O   s    
r   rB   N)utilsr   r   r   rB   r
   r   r   <module>rO      s!    3H$ H$V

S 

r   