+
     h  c                  s    ^ RI Ht ^ RIt^ RIHtHt ^ RIHt ^ RIH	t	H
t
 ] ! R R]4      4       t ! R R	]P                  4      t ! R
 R]4      tR# )i    )annotationsN)IntEnumunique)Event)CallableIteratorc                  s"    ] tR t^$tRt^t^tRtR# )STATUSz(Status code for CTAP keep-alive message. N)__name__
__module____qualname____firstlineno____doc__
PROCESSINGZUPNEEDED__static_attributes__r       //usr/lib/python3.14/site-packages/fido2/ctap.pyr   r   $   s    2JHr   r   c                  s    ] tR t^,tRt]]P                  R R l4       4       t]P                  RR R ll4       t	R R lt
R	 tR
 t]]P                  R R l4       4       tRtR# )
CtapDevicez
CTAP-capable device.

Subclasses of this should implement :func:`call`, as well as :func:`list_devices`,
which should return a generator over discoverable devices.
c                   V ^8  d   QhRR/#    returnintr   Zformat   "r   __annotate__CtapDevice.__annotate__6   s     & &c &r   c                    R# )zGet device capabilitiesNr   self   &r   capabilitiesZCtapDevice.capabilities4       r   Nc          
     s,    V ^8  d   QhRRRRRRRRR	R/# )
r   cmdr   dataZbyteseventzEvent | Noneon_keepalivezCallable[[STATUS], None] | Noner   r   r   r   r   r   r   :   s<        	
 6 
r   c                r   )a  Sends a command to the authenticator, and reads the response.

:param cmd: The integer value of the command.
:param data: The payload of the command.
:param event: An optional threading.Event which can be used to cancel
    the invocation.
:param on_keepalive: An optional callback to handle keep-alive messages
    from the authenticator. The function is only called once for
    consecutive keep-alive messages with the same status.
:return: The response from the authenticator.
Nr   )r   r!   r"   r#   r$   s   &&&&&r   callZCtapDevice.call9   r    r   c               r   )r   r   ZNoner   r   r   r   r   r   M   s     > >t >r   c                r   )z/Close the device, releasing any held resources.Nr   r   r   r   closeZCtapDevice.closeM   r    r   c                	s    V # Nr   r   r   r   	__enter__ZCtapDevice.__enter__P   s    r   c                	s&    V P                  4        R # r'   )r&   )r   ZtypvalueZ	tracebacks   &&&&r   __exit__ZCtapDevice.__exit__S   s    

r   c               r   )r   r   zIterator[CtapDevice]r   r   r   r   r   r   X   s     C C1 Cr   c                r   )z4Generates instances of cls for discoverable devices.Nr   )Zclsr   r   list_devicesZCtapDevice.list_devicesV   r    r   r   )r   NN)r   r	   r
   r   r   propertyabcZabstractmethodr   r%   r&   r(   r*   Zclassmethodr+   r   r   r   r   r   r   ,   sv     &  & 	 &> C  Cr   r   c                  sh   a  ] tR t^\tRt ! R R]4      t] ! R R]4      4       t	R V 3R llt
RtV ;t# )		CtapErrorz;Error returned from the Authenticator when a command fails.c                  s@    ] tR t^_tRtRt]R R l4       tR tR t	Rt
R# )	CtapError.UNKNOWN_ERRz.CTAP error status code that is not recognized.UNKNOWN_ERRc               r   r   r   r   r   r   r   Z"CtapError.UNKNOWN_ERR.__annotate__e   s     	 	3 	r   c                	s    \        V 4      # r'   )r   r   r   r   r)   ZCtapError.UNKNOWN_ERR.valued   s    t9r   c                	s    R V ,          # )z<ERR.UNKNOWN: %d>r   r   r   r   __repr__ZCtapError.UNKNOWN_ERR.__repr__h   s    &--r   c                	s    R V R R2# )0x02Xz
 - UNKNOWNr   r   r   r   __str__ZCtapError.UNKNOWN_ERR.__str__k   s    Sz,,r   r   N)r   r	   r
   r   r   namer,   r)   r1   r4   r   r   r   r   r0   r/   _   s&    <		 
		.	-r   r0   c                  s    ] tR t^ntRt^ t^t^t^t^t	^t
^t^
t^t^t^t^t^t^t^t^t^!t^"t^#t^$t^%t^&t^'t^(t^+t^,t^-t^.t ^/t!^0t"^1t#^2t$^3t%^4t&^5t'^6t(^7t)^8t*^9t+^:t,^;t-^<t.^=t/^>t0^?t1^@t2^t3^t4^t5^t6^t7^t8R t9Rt:R# )CtapError.ERRzCTAP status codes.

https://fidoalliance.org/specs/fido-v2.1-rd-20201208/fido-client-to-authenticator-protocol-v2.1-rd-20201208.html#error-responses
c                	s<    R V P                   R RV P                   2# )r2   r3   z - )r)   r5   r   r   r   r4   ZCtapError.ERR.__str__   s     

3's499+66r   r   N);r   r	   r
   r   r   ZSUCCESSZINVALID_COMMANDZINVALID_PARAMETERZINVALID_LENGTHZINVALID_SEQZTIMEOUTZCHANNEL_BUSYZLOCK_REQUIREDZINVALID_CHANNELZCBOR_UNEXPECTED_TYPEZINVALID_CBORZMISSING_PARAMETERZLIMIT_EXCEEDEDZFP_DATABASE_FULLZLARGE_BLOB_STORAGE_FULLZCREDENTIAL_EXCLUDEDr   ZINVALID_CREDENTIALZUSER_ACTION_PENDINGZOPERATION_PENDINGZNO_OPERATIONSZUNSUPPORTED_ALGORITHMZOPERATION_DENIEDZKEY_STORE_FULLZUNSUPPORTED_OPTIONZINVALID_OPTIONZKEEPALIVE_CANCELZNO_CREDENTIALSZUSER_ACTION_TIMEOUTZNOT_ALLOWEDZPIN_INVALIDZPIN_BLOCKEDZPIN_AUTH_INVALIDZPIN_AUTH_BLOCKEDZPIN_NOT_SETZPUAT_REQUIREDZPIN_POLICY_VIOLATIONZPIN_TOKEN_EXPIREDZREQUEST_TOO_LARGEZACTION_TIMEOUTZUP_REQUIREDZ
UV_BLOCKEDZINTEGRITY_FAILUREZINVALID_SUBCOMMANDZ
UV_INVALIDZUNAUTHORIZED_PERMISSIONZOTHERZ	SPEC_LASTZEXTENSION_FIRSTZEXTENSION_LASTZVENDOR_FIRSTZVENDOR_LASTr4   r   r   r   r   ERRr6   n   s*   	
  # "&"
!"  $ ""#  
 !
"&		7r   r7   c               r   )r   coder   r   r   r   r   r   ZCtapError.__annotate__   s     5 5S 5r   c                	s   <  \         P                  V4      V n        \
        SV `  R V P                   24       R#   \         d    \         P	                  T4      T n         LEi ; i)zCTAP error: N)r.   r7   r8   Z
ValueErrorr0   Zsuper__init__)r   r8   	__class__s   &&r   r9   ZCtapError.__init__   sU    	4!d+DI 	<		{34  	4!--d3DI	4s   ; %A#"A#)r8   )r   r	   r
   r   r   r   r0   r   r   r7   r9   r   Z__classcell__)r:   s   @r   r.   r.   \   s8    E-c - ?7g ?7 ?7B5 5r   r.   )Z
__future__r    r-   Zenumr   r   Z	threadingr   Ztypingr   r   r   ZABCr   Z	Exceptionr.   r   r   r   <module>r;      sR   8 # 
    % W  -C -C`Y5	 Y5r   