+
     h  c                   s<   R t ^ RIt^ RIHt ^ RIHtHtHtHtH	t	H
t
Ht ^ RIHt ^ RIHtHtHtHtHtHtHtHtHtHtHt ^ RIHtHt ^ RIHtHt ^ RI H!t!H"t"H#t# ^ R	I$H%t% R
t&]R,           t']R,           t( ! R R]4      t)R R lt*R R lt+R R lt,R R lt-R R lt.R# )zkThis module provides some utility functions, but these shouldn't
normally be used by external applications.N)Any)DBusAddressDBusErrorResponse	MatchRuleMessageMessageTypenew_method_call
PropertiesDBusConnection)DBUS_UNKNOWN_METHODDBUS_NO_SUCH_OBJECTDBUS_SERVICE_UNKNOWNDBUS_NO_REPLYDBUS_NOT_SUPPORTEDDBUS_EXEC_FAILEDDBUS_UNKNOWN_OBJECTSS_PATH	SS_PREFIXALGORITHM_DHALGORITHM_PLAIN)Sessionint_to_bytes)ItemNotFoundException"SecretServiceNotAvailableException)Cipher
algorithmsmodes)default_backendzorg.freedesktop.secretsZServicePromptc                   s~   a  ] tR t^t o RtV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR	 ltV 3R
 lR lt	Rt
V tR# )DBusAddressWrapperzA wrapper class around :class:`jeepney.wrappers.DBusAddress`
that adds some additional methods for calling and working with
properties, and converts error responses to SecretStorage
exceptions.

.. versionadded:: 3.0
c                0   < V ^8  d   QhRS[ RS[ RS[RR/# )   path	interface
connectionreturnN)strr	   format__classdict__   "7/usr/lib/python3.14/site-packages/secretstorage/util.py__annotate__DBusAddressWrapper.__annotate__'   s+     & &S &S &+&04&    c                sJ    \         P                  ! W\        V4       W0n        R # N)r   __init__BUS_NAME_connection)selfr!   r"   r#   s   &&&&r*   r/   ZDBusAddressWrapper.__init__'   s    T9=%r-   c                &   < V ^8  d   QhRS[ RS[/# )r    msgr$   )r   r    r&   r)   r*   r+   r,   ,   s      g # r-   c                s    V P                   P                  V4      pVP                  P                  \        P
                  8X  d   \        V4      hVP                  #   \         d   pTP                  \        \        \        39   d   \        R 4      ThTP                  \        \        \        39   d8   TP                   p\#        T\$        4      '       d
   T^ ,          p\'        T4      Thh Rp?ii ; i)zItem does not exist!N)r1   send_and_get_replyZheaderZmessage_typer   Zerrorr   bodynamer
   r   r   r   r   r   r   data
isinstancetupler   )r2   r4   Zresp_msgrespr8      &&   r*   r5   Z%DBusAddressWrapper.send_and_get_reply,   s    	 $ 0 0 C CC HH++{/@/@@'11==   	yy### 
 ,,BCM35E,. .yydE**7D8>DH	s   AA C1(BC,,C1c                s2   < V ^8  d   QhRS[ RS[ RS[RS[/# )r    method	signaturer6   r$   r%   r    r&   r)   r*   r+   r,   A   s)     , ,3 ,3 ,s ,s ,r-   c                s<    \        WW#4      pV P                  V4      # r.   )r   r5   )r2   r=   r>   r6   r4   s   &&&* r*   callZDBusAddressWrapper.callA   s    dI<&&s++r-   c                r3   )r    r7   r$   r?   r&   r)   r*   r+   r,   E   s        r-   c                sd    \        V 4      P                  V4      pV P                  V4      w  w  r4V# r.   )r   Zgetr5   )r2   r7   r4   r>   valuer<   r*   get_propertyZDBusAddressWrapper.get_propertyE   s2    ""4("55c:r-   c                r   )r    r7   r>   rA   r$   Nr?   r&   r)   r*   r+   r,   J   s)     % % % %S %T %r-   c                s^    \        V 4      P                  WV4      pV P                  V4       R # r.   )r   Zsetr5   )r2   r7   r>   rA   r4   s   &&&& r*   set_propertyZDBusAddressWrapper.set_propertyJ   s'    ""4E:$r-   )r1   N)Z__name__Z
__module__Z__qualname__Z__firstlineno____doc__r/   r5   r@   rB   rC   Z__static_attributes__Z__classdictcell__)r(   s   @r*   r   r      s<     & &
 *, , 
% %r-   r   c                s0    V ^8  d   QhR\         R\        /# )r    r#   r$   )r	   r   r'      "r*   r+   r+   O   s      ^  r-   c           	     s   \        \        \        V 4      p\        4       p VP	                  RR\
        R\        VP                  4      34      w  r4Vw  rV\        P                  VR4      pVP                  V4       WBn        V#   \         dB   pTP                  \        8w  d   h TP	                  RR\        R4      w  r4RTn         Rp?LORp?ii ; i)z%Returns a new Secret Service session.ZOpenSessionZsvZayZbigFN)s )r   r   SERVICE_IFACEr   r@   r   r   Zmy_public_keyZintZ
from_bytesZset_server_public_keyr   r7   r   r   	encryptedobject_path)	r#   servicesessionZoutputresultr>   rA   Zkeyr;   s	   &        r*   open_sessionrO   O   s     -DGiG+ 4< 5 5679 "	nnUE*%%c* N  "99** 4 ""s   /B C7C

Cc                s~    V ^8  d   QhR\         R\        R\        R\        \        \        \        \        3,          /# )r    rM   secretcontent_typer$   )r   bytesr%   r:   rE   rF   r*   r+   r+   i   s8      7 E  #(-c5%.D(Er-   c                s   \        V\        4      '       d   VP                  R4      pM!\        V\        4      '       g   \	        R4      hV P
                  '       g   V P                  RW3# ^\        V4      ^,          ,
          pV\        V3V,          4      ,          p\        P                  ! ^4      p\        P                  ! V P                  4      p\        V\        P                  ! V4      \!        4       4      P#                  4       pVP%                  V4      VP'                  4       ,           pV P                  VVV3# )zGFormats `secret` to make possible to pass it to the
Secret Service API.zutf-8zsecret must be bytesr-   )r9   r%   ZencoderR   Z	TypeErrorrJ   rK   lenosZurandomr   ZAESZaes_keyr   r   ZCBCr   	encryptorZupdateZfinalize)rM   rP   rQ   ZpaddingZaes_ivZaesrU   Zencrypted_secrets   &&&     r*   format_secretrV   i   s     &#w'&&.//##S&?? c&kC'(G
eWJ())FZZF
..
)CsEIIf-/@AKKMI ''/)2D2D2FF	 r-   c          	      st    V ^8  d   QhR\         R\        R\        \        \        \        ,          3,          /# )r    r#   prompt_pathr$   )r	   r%   r:   boollistrE   rF   r*   r+   r+      s0      N  %*4c?%;r-   c                s<   \        V\        V 4      p\        V\        R\        P                  R7      pV P                  V4      ;_uu_ 4       pVP                  RRR4       V P                  V4      P                  w  rVRRR4       WV3#   + '       g   i     XX3# ; i)zExecutes the prompt in a blocking mode.

:returns: a tuple; the first element is a boolean value showing
          whether the operation was dismissed, the second element
          is a list of unlocked object paths
Z	Completed)r!   r"   ZmemberZtyper   rG   rH   N)	r   PROMPT_IFACEr   r   ZsignalZfilterr@   Zrecv_until_filteredr6   )r#   rW   promptruleZsignals	dismissedrN   s   &&     r*   exec_promptr^      s      \:FF	D 
		4	 	 GHc2&&::7CHH	 
!
  
!	 
 fs   1BB	c                sR    V ^8  d   QhR\         R\        \        ,          R\        /# )r    r#   pathsr$   )r	   rY   r%   rX   rE   rF   r*   r+   r+      s%      ~ d3i D r-   c                s    \        \        \        V 4      pVP                  RRV4      w  r4\	        V4      ^8  d   \        W4      w  pw  rgV# R# )zRequests unlocking objects specified in `paths`.
Returns a boolean representing whether the operation was dismissed.

.. versionadded:: 2.1.2ZUnlockZaoF)r   r   rI   r@   rS   r^   )r#   r_   rL   Zunlocked_pathsr[   r]   r>   Zunlockeds   &&      r*   unlock_objectsr`      sM    
 !-DG$\\(D%@N
6{Q+6z+J(	(Ir-   c                s(    V ^8  d   QhR\         RR/# )r    r#   r$   Nr   rE   rF   r*   r+   r+      s     1 1 14 1r-   c                s    \        \        \        R7      p\        RRV R7      pRVn        VP                  RRVP                  4       4       R# )zAdds match rules for the given connection.

Currently it matches all messages from the Prompt interface, as the
mock service (unlike GNOME Keyring) does not specify the signal
destination.

.. versionadded:: 3.1
)Zsenderr"   z/org/freedesktop/DBuszorg.freedesktop.DBus)r!   r"   r#   ZAddMatchrG   N)r   r0   rZ   r   Zbus_namer@   Z	serialise)r#   r\   Zdbuss   &  r*   add_match_rulesra      sC     H=D#:(>)35D +DMIIj#t~~/0r-   )/rD   rT   Ztypingr    Zjeepneyr   r   r   r   r   r   r   Zjeepney.io.blockingr	   Zsecretstorage.definesr
   r   r   r   r   r   r   r   r   r   r   Zsecretstorage.dhcryptor   r   Zsecretstorage.exceptionsr   r   Z&cryptography.hazmat.primitives.ciphersr   r   r   Zcryptography.hazmat.backendsr   r0   rI   rZ   r   rO   rV   r^   r`   ra   ) r-   r*   <module>rb      s   . 
    /H H H H 9$ L L 8$I%8#-% -%`46.1r-   