
    k7i	                     D     " S  S5      r  " S S\5      r " S S\5      rg)c                   :    \ rS rSrSrSrSrSrSrS r	S r
S rS	rg)
JWSAlgorithm   zInterface for JWS algorithm. JWA specification (RFC7518) SHOULD
implement the algorithms for JWS with this base implementation.
NJWSalgc                     [        5       e)z0Prepare key for signing and verifying signature.NotImplementedError)selfraw_datas     U/home/james-whalen/.local/lib/python3.13/site-packages/authlib/jose/rfc7515/models.pyprepare_keyJWSAlgorithm.prepare_key   s    !##    c                     [         e)zSign the text msg with a private/sign key.

:param msg: message bytes to be signed
:param key: private key to sign the message
:return: bytes
r   )r
   msgkeys      r   signJWSAlgorithm.sign   s
     "!r   c                     [         e)zVerify the signature of text msg with a public/verify key.

:param msg: message bytes to be signed
:param sig: result signature to be compared
:param key: public key to verify the signature
:return: boolean
r   )r
   r   sigr   s       r   verifyJWSAlgorithm.verify   s
     "!r    )__name__
__module____qualname____firstlineno____doc__namedescriptionalgorithm_typealgorithm_locationr   r   r   __static_attributes__r   r   r   r   r      s-     DKN$""r   r   c                   <   ^  \ rS rSrSrU 4S jr\S 5       rSrU =r	$ )	JWSHeader#   a  Header object for JWS. It combine the protected header and unprotected
header together. JWSHeader itself is a dict of the combined dict. e.g.

    >>> protected = {"alg": "HS256"}
    >>> header = {"kid": "a"}
    >>> jws_header = JWSHeader(protected, header)
    >>> print(jws_header)
    {'alg': 'HS256', 'kid': 'a'}
    >>> jws_header.protected == protected
    >>> jws_header.header == header

:param protected: dict of protected header
:param header: dict of unprotected header
c                    > 0 nU(       a  UR                  U5        U(       a  UR                  U5        [        TU ]	  U5        Xl        X l        g )N)updatesuper__init__	protectedheader)r
   r+   r,   obj	__class__s       r   r*   JWSHeader.__init__3   s=    JJvJJy!"r   c                 t    [        X5      (       a  U$ U " UR                  S5      UR                  S5      5      $ )Nr+   r,   )
isinstanceget)clsr-   s     r   	from_dictJWSHeader.from_dict=   s1    cJ377;'):;;r   )r,   r+   )
r   r   r   r   r   r*   classmethodr4   r#   __classcell__r.   s   @r   r%   r%   #   s!     < <r   r%   c                   @   ^  \ rS rSrSrSU 4S jjr\S 5       rSrU =r	$ )	JWSObjectD   z*A dict instance to represent a JWS object.c                 F   > [         TU ]  UUS9  Xl        X l        X0l        g )N)r,   payload)r)   r*   r,   r=   type)r
   r,   r=   r>   r.   s       r   r*   JWSObject.__init__G   s,     	 	
 	r   c                 .    U R                   S:X  a  U S   $ g)z'Alias of ``header`` for JSON typed JWS.jsonr,   N)r>   )r
   s    r   headersJWSObject.headersP   s     99>! r   )r,   r=   r>   )compact)
r   r   r   r   r   r*   propertyrB   r#   r7   r8   s   @r   r:   r:   D   s    4 " "r   r:   N)r   dictr%   r:   r   r   r   <module>rG      s)   " "D< <B" "r   