+
    :iX  c                   s   ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIt^ RIt^ RI	H
t
 ^ RIHtHt ^ RIHt ^ RIHt ^ RIHt ^ RIHtHtHtHt ^ R	IHt ^ R
IHt ^ RIHtHt ^RI H!t! ^RI"H#t$ ^RI"H%t% ^RI&H't'H(t( ^RIH)t) ^RI*H+t, ^RI*H-t- ^RI.H/t/ ^RI0H1t1H2t2H3t3H4t4H5t5 ^RI6H6t6 ^RI7H7t7 ^RI8H8t8 ^RI9H9t9 ^RI:H:t: ^RI;H;t; ^RI<H<t< ^RI=H=t= ^RI>H>t> ^RI?H@t@ ^RIAHBtBHCtCHAtA ^R I0HDtDHEtEHFtFHGtGHHtHHItIHJtJHKtKHLtL ]P                  ! ]N4      tO]P! R!R".R#R$7      tQ]P                  R%8H  ;'       dB    ]S! ] P                  P                  P                  4       4      '       * ;'       d    ]2! 4       Rt8  tWRuR& ltXR' tYR( tZR) t[R* t#RvR+ lt\]H! ]QR,7      ]P                  ! R-R.]^R/R0R1 R27      ]P                  ! R3R4R5R6RR7 R87      ]P                  ! R9R:]P                  ! R;4      R<R=7      ]P                  ! R>R?R@]B! 4       ]F! 4       3Rw]CRA]P                  9  RBRC7      ]P                  ! RDRER@]F! 4       ^RwRA]P                  9  RFRG7      ]P                  ! RHRIRJRKRLRMRN7      ]P                  ! RORPRQRRRSRT7      ]P                  ! RURVR]E! ]]P                  .RW7      RXRY7      ]P                  ! RZR]bR[R\R]7      ]P                  ! R^RL]ZR_RLR`Ra7      ]P                  ! RbRcRL]YR_RLRdRa7      ]P                  ! RARLR_ReRf7      ]P                  Rg 4       4       4       4       4       4       4       4       4       4       4       4       4       4       td]dP                  Rh4      ]P                  ! RHRiRLRjRk7      ]P                  ! R3RlRLRmRk7      ]P                  Rn 4       4       4       4       tfRxRo ltg]f]:]=]<];]>]8]7]6]@]9]A3th]h F  ti]dP                  ]i4       K  	   ! Rp Rq]P                  4      tlRr tm]NRs8X  d
   ]m! 4        R# R# )y    N)replace)InvalidSignature)ApplicationNotAvailableError_override_version)FidoConnection)OtpConnection)SmartCardConnection)KeyRefScp03KeyParamsScpKid
StaticKeys)	LOG_LEVEL)RELEASE_TYPE)get_name	read_info)__version__)list_all_devices)scan_devices)get_diagnosticssys_info)init_logging)list_devices)list_readers)AppData)InvalidPasswordErrorget_windows_versionis_nfc_restrictedparse_certificatesparse_private_key)apdu)config)fido)hsmauth)info)oath)openpgp)otp)piv)
run_script)ScpKidParamTypeclick_parse_scp_refsecuritydomain)	CliFail
EnumChoiceHexIntParamTypeYkmanContextObjectclick_groupclick_promptfind_scp11_paramsorganize_scp11_certificatespretty_printz-h--helpi  )Zhelp_option_namesZmax_content_widthZwin32c                 s    \        V4       F0  p\        P                  ! R 4       \        4       w  r4W@8w  g   K-  W43u # 	  \	        R4      h)g      ?z"Timed out waiting for state change)rangetimeZsleepr   TimeoutError)stateZattempts_devicesZ	new_states   &&   8/usr/lib/python3.14/site-packages/ykman/_cli/__main__.py_scan_changesr<   h   sC    8_

4)^%%	 
 ;
<<    c                 s    V'       d   V P                   '       d   R # \        P                  ! R\         24       V P	                  4        R # )Nz!YubiKey Manager (ykman) version: )resilient_parsingclickechor   exitctxparamvalue   &&&r;   print_versionrG   q   s0    C)))	JJ2;-@AHHJr=   c                 s    V'       d   V P                   '       d   R # \        P                  ! RP                  \	        \        4       4      4      4       V P                  4        R # )N
)r>   r?   r@   joinr3   r   rA   rB   rF   r;   print_diagnosticsrJ   x   s9    C)))	JJtyyo&789:HHJr=   c                 s   \         V 9   g   \        V 9   d   \        V4      p\        V4      ^8X  dN   V^ ,          pRp VP	                  \         4      ;_uu_ 4       p \        WSP                  4      pW63uuRRR4       # \        V4      ^8  d   \        R4      h\        R4      h\        R4      h  \         d    \        T4      ph i ; i  + '       g   i     R# ; i  \         d     T'       d   \        R4      h\        R4      hi ; i)   FNzQYubiKey is in NFC restricted mode (see: https://www.yubico.com/getting-started/).Failed to connect to YubiKey.z%Multiple external readers match name.z$No YubiKey found on external reader.zNot a CCID command.)r   r   	list_ccidlenZopen_connectionr   pid
ValueErrorr   	Exceptionr+   )connection_typesreaderreadersdevZnfc_restrictedconnr"   s   &&     r;   require_readerrW      s    ...DT2TF#w<1!*C"N?(()<==(ww7"y >= \AABB@AA+,, & ):4)@	 >==  ?!!J  =>>?sA   C CB04
C 0CCC	C C D	2D	c                  sB   \        V / VB pV UUu. uF  w  r4VP                  '       g   K  W43NK  	  pppV'       d   \        R 4      pVP                  R/ 4      pV FV  w  r4VP                  '       g   K  \	        VP                  4      pVP                  VR4      ;'       g    \        W4R4      Wx&   KX  	  \        VP                  4       4      R\        ^\        V4      4      )   Uu. uF  qP                  V4      NK  	   pVP                  4        V# u uppi u upi )historyr:   NF)_list_all_devicesserialr   Z
setdefaultstrpop_describe_devicelistkeysZmaxrN   Zwrite)	argsZkwargsr:   rU   dev_infoZwith_serialrX   Zcacheks	   *,       r;   r   r      s    00G:AU'X__?C?'KU)$""9b1(MC( 99Q-WW1A#QV1W )
  $EJJL12MSC<L5M4MNON!1NON V 	Ps   DD)Dc                 s   \        4       w  r#\        VP                  4       4      pVEf   V^ 8X  d(    \        V4      w  r#\        VP                  4       4      pV^8  d   \        4       p\        P                  ! RRR7       V FU  w  rg\        P                  ! R\        Wg4      ,           VP                  '       d   RVP                   2MR,           RR7       KW  	  \        R4      h\        \        VP                  4       4      4      pV  U	u. uF  qP                  V	4      '       g   K  V	NK  	  p
p	\        '       d   V
\         .8X  d   \        R	4      hV
'       gB   V  U	u. uF  qP"                  NK  	  pp	R
P%                  R V 4       4      p\        RV R24      h\        V
4      p\'        V4      ^8w  d   \        R4      hV^ ,          # R FI  p\        V 4      pV F  w  rgVP                  V8X  g   K  Wg3u u # 	   V'       d   \        V4      w  rKI  KK  	  \        RV R24      h  \         d    \        R4      hi ; iu up	i u up	i   \         d      KB  i ; i)NzNo YubiKey detected!zMultiple YubiKeys detected:T)Zerrz- 	 Serial:  z0Use --device SERIAL to specify which one to use.9FIDO access on Windows requires running as Administrator.z, c              3   s^   "   T F#  qP                   ;'       g    \        V4      x  K%  	  R # 5iN)namer[   ).0Zt   & r;   	<genexpr>Z!require_device.<locals>.<genexpr>   s!     AjFF,,c!f,js   --zECommand requires one of the following USB interfaces to be enabled: 'z='.

Use 'ykman config usb' to set the enabled USB interfaces.rL   z,Failed connecting to a YubiKey with serial: z9.
Make sure the application has the required permissions.)TF)r   ZsumZvaluesr<   r7   r+   r   r?   r@   r]   rZ   nextZiterr_   Zsupports_connectionWIN_CTAP_RESTRICTEDr   Zusb_interfacerI   rN   )rR   rZ   r:   r8   Zn_devsZdevices_listrU   ra   rO   cZ	supportedZ
interfacesZreqdevsZretryr9   s   &&              r;   require_devicero      sL   !^NG!"F~Q;6!.u!5W^^-. A:+-LJJ4$?!-

&s568@8??"34RQ 	 ". LMM 4'( 0O 014K4KA4NQQ 0	O90@#@UVV3CD3Ca//3CJD))AjAAC##&% (LL   	*t9>9::Aw
E $$45D!%??f,=( "&,U3HAu 
 :6( CF F
 	
a   64556  P
 E0   s5   &H, I+I"II
I,II I )Zcontext_settingsz-d--deviceZSERIALz7specify which YubiKey to interact with by serial numberc           	      s    \        R 4      P                  R/ 4      P                  4        UUu. uF?  w  r4VP                  V4      '       g   K  \        P
                  P                  VVR7      NKA  	  upp# u uppi )rX   r:   )help)r   ZgetitemsZ
startswithr?   Zshell_completionZCompletionItem)rC   rD   
incompleterZ   descriptions   &&&  r;   <lambda>ru      st    
 $+9#5#9#9)R#H#N#N#P3
 $QFZ(	
-- 	. 	
 $Q3 3s   A6%A6)typemetavarrq   shell_completez-rz--readerzQspecify a YubiKey by smart card reader name (can't be used with --device or list)ZNAMEc                 s\    \        4        Uu. uF  pR VP                   R 2NK  	  up# u upi )Z")r   rg   )rC   rD   rs   rS   s   &&& r;   ru   ru     s-    )53)7v!FKK=3 3s   ))rq   rw   defaultrx   z-tz--scp-carbz<specify the CA to use to verify the SCP11 card key (CA-KLCC))rv   rq   z-cz--scp-sdzKID KVN--full-helpz6specify which key the YubiKey is using to authenticate)rw   rv   ry   callbackhiddenrq   z-oz	--scp-ocez2specify which key the OCE is using to authenticate)rw   rv   Znargsry   r}   rq   z-sz--scpscp_credZCREDTzspecify private key and certificate chain for secure messaging, can be used multiple times to provide key and certificates in multiple files (private key, certificates in leaf-last order), OR SCP03 keys in hex separated by colon (:) K-ENC:K-MAC[:K-DEK])rw   Zmultiplerq   z-pz--scp-passwordscp_cred_passwordZPASSWORDz?specify a password required to access the --scp file, if needed)rw   rq   z-lz--log-level)r}   z'enable logging at given verbosity level)ry   rv   rq   z
--log-fileZFILEzFwrite log to FILE instead of printing to stderr (requires --log-level))ry   rv   rw   rq   z
--diagnoseFz7show diagnostics information useful for troubleshooting)is_flagr|   expose_valueZis_eagerrq   z-vz	--versionz&show version information about the appz-show --help output, including hidden commands)r   r   rq   c
           	     s
  a aaa	aaaaaaa a!a" \        4       S n        V'       dH   \        WxVRJ R7       \        P	                  RP                  \        R\        4       /4      4      4       MV'       d   S P                  R4       S	'       d   S'       d   S P                  R4       \        \        V4      ;'       g    T;'       g    T4      p
\        V 3R l\         4       4      pV\        39   dN   S'       d   S P                  R4       S	'       d   S P                  R	4       V
'       d   S P                  R
4       R# V\        8X  d   \        '       d   \!        R4      h\#        VR\$        \&        \(        .4      oS'       Edv   VVV	V3R loS P                  P+                  RV3R l4       S P                  P+                  RV3R l4       S P                  P+                  RV3R l4       V
'       Ed   \$        S9  d   \!        R4      hVw  o o!S '       d    \-        S 4      o V'       d   VP1                  4       oMRoRp\2        P4                  ! RV RV RV R24      p\7        V4      ^8X  dH   VP9                  V^ ,          4      '       d*   \;        R V^ ,          P=                  R4       4       !  oRpMH\>        P@                  ! R4      pV Uu. uF$  pVPC                  VRS 4      P1                  4       NK&  	  ppRoS '       g2   S'       d   \,        PD                  o MV'       g   \,        PF                  o S'       d!   S \,        PD                  8w  d   \!        R4      hS \,        PD                  8X  d   V'       d   \!        R4      hVV!3R  lpVoEM9V'       d   S '       d1   S \,        PH                  \,        PJ                  39  d   \!        R!4      hVPM                  ^ 4      pV'       d   VPO                  4       MRp  \Q        VV4      o" T'       d(   . oT F  pSPY                  \[        TR4      4       K   	  M.\[        TT4      o\]        S4      w  ppp\_        T4      T.,           oTTT T!TT"3R* lpToMTS \,        PF                  R39  d   \!        S P`                   R+24      h\        S4      '       d   \!        R,4      hVV!3R- lpVo\$        .oS P                  P+                  R.V3R/ l4       R# R# R#   \.         d    \!        RS  R24      hi ; iu upi   \R         dM    T'       d   \!        R#4      h\        PU                  R$R"R%7       \W        R&R'R"R(R)7      PO                  4       p EKt  i ; i)0z
Configure your YubiKey via the command line.

Examples:


  List connected YubiKeys, only output serial number:
  $ ykman list --serials


  Show information about YubiKey with serial number 123456:
  $ ykman --device 123456 info
N)log_filer   rH   zSystem infoz+--log-file requires specifying --log-level.z0--reader and --device options can't be combined.c              3   s`   <"   T F#  qP                   SP                  8X  g   K  Vx  K%  	  R # 5irf   )rg   Zinvoked_subcommand)rh   rm   rC   s   & r;   rj   cli.<locals>.<genexpr>~  s"     JX33I3I)I!!Xs   .
.z)--device can't be used with this command.z)--reader can't be used with this command.z$SCP can't be used with this command.re   connectionsc                  sf  < \        SR R4      p V '       g   Se   \        SS4      p M\        SS4      p V ^,          P                  P                  \
        P                  8w  dA   V ^,          P                  p\        VP                  4       \        P                  RV 24       \        SR V 4       V # )rr   NzDebug key detected: )getattrrW   ro   Zversion_qualifierrv   r   ZFINALr   Zversionloggerr"   Zsetattr)rr   Z	version_qr   devicerS   resolves     r;   r   Zcli.<locals>.resolve  s    GWd3E%*;?E*;?E8--22l6H6HH %a : :I%i&7&78KK"6yk BC%0Lr=   r   c                  s    < S ! 4       ^ ,          # r     r      r;   ru   cli.<locals>.<lambda>  s    wy|r=   rO   c                  s4   < S ! 4       ^ ,          P                   # r   )rO   r   r   r;   ru   r     s    GIaL,<,<r=   r"   c                  s    < S ! 4       ^,          # )rK   r   r   r   r;   ru   r     s    WYq\r=   z(SCP can only be used with CCID commands.z"Invalid KID for card certificate: Z.z[0-9a-fA-F]{32}Z^Z:z(:z)?$c              3   sL   "   T F  p\         P                  V4      x  K  	  R # 5irf   )ZbytesZfromhex)rh   rb   ri   r;   rj   r     s     G0F1emmA&&0Fs   "$rz   z2--scp with SCP03 keys can only be used with SCP03.z%--scp-ca can only be used with SCP11.c                 s   < \        \        \        P                  S4      S;'       g    \        P
                  ! 4       R 7      # ))Zrefr_   )r	   r   r
   SCP03r   ry   )r9   
scp03_keysscp_kvn   &r;   params_f_scp03Zcli.<locals>.params_f_scp03  s2    )"6<<9'??:+=+=+? r=   z3--scp with file(s) can only be used with SCP11 a/c.Tz&Wrong password to decrypt private key.zError parsing key)exc_infoz#Enter password to decrypt SCP11 keyrd   F)ry   Z
hide_inputZshow_defaultc                 s<  < S'       g    \        V \        P                  SS4      pM\        V SSS4      p\        V\        S!  SSR7      #   \        \        3 d?   p \        T \        P
                  SS4      p R p?LI  \        \        3 d    Thi ; iR p?ii ; i)N)Zoce_refsk_oce_eckacertificates)r1   r
   SCP11arP   r   SCP11cr   r   )	rV   Zparamsecar   scp_kidr   scp_ocer   s	   &  r;   params_f_scp11abZcli.<locals>.params_f_scp11ab  s    "(%6tV]]GUW%XF "34'2!N" & 0$/%1	  !+,<= (():$(&--"*" %/0@#A (&'((s#   A BA??BBBz requires --scp.z%SCP11b cannot be used with --scp-oce.c                 s<   < \        V \        P                  SS4      # rf   )r1   r
   SCP11b)rV   r   r   r   r;   params_f_scp11bZcli.<locals>.params_f_scp11b  s    ,T6=='2NNr=   Zscpc                  s   < S # rf   r   )params_fr   r;   ru   r   !  s    r=   )1r.   objr   r   r"   rI   r3   r   ZfailboolZanyrk   COMMANDS	list_keysr    rl   r+   r   r   r   r   Zadd_resolverr
   rP   ZreadreZcompilerN   Zmatchr   splitr?   FileZconvertr   r   r   r   r\   Zencoder   r   Zdebugr0   Zextendr   r2   r^   rg   )#rC   r   Zscp_caZscp_sdr   r~   r   Z	log_levelr   rS   Zuse_scpZsubcmdZkey_fmtZre_hex_keysZscp11_credsZfZfnr   ZfirstZpasswordrm   r9   ZinterZleafr   r   r   r   r   r   r   r   r   r   r   s#   ff&&f&&&&f                @@@@@@@@@r;   clir      sj   L !"CGY8t;KLDIIlM8:+FGHI	>?&CD3v;44(44f5GJXJJF)HH@AHH@AHH;< ~--QRR  3^]SK {	 	$ 	X';<U$<=V%9:7"+5HII%GWS$WoG [[](G**'!G9Bwis%KLK8}!k&7&7&D&D'G0A0A#0FG
 #JJt$IQR2qyyT37<<>R!
$llG$$mmGg5RSS&,,&!"IJJ *wv}}fmm.LL!"WXX#*9J,335PT#&7x&H #%L($++,>q$,GH ) $6eX#FL%@%NNAud#';$#7L , , 6==$"77!W\\N2B"CDDw<<!"IJJO +./KGG  (89q 1 @ " S!$Fwiq"QRRS" SH 0 	#,")*R"SS%84H#/A$&'+).	$
 !&( !		#s*   S> *TT! >T!U84?U87U8r^   z	--serialszQoutput only serial numbers, one per line (devices without serial will be omitted))r   rq   z	--readersz!list available smart card readersc                sh   V'       dB   \        4        F#  p\        P                  ! VP                  4       K%  	  V P	                  4        \        4       p\        4        F  w  rVV'       d4   VP                  '       d!   \        P                  ! VP                  4       MG\        P                  ! \        WV4      VP                  '       d   RVP                   2MR,           4       VP                  VP                  4       K  	  V'       g   \        4       w  rxVP                  4        F  w  rW9  g   K  \        V
4       Fh  pV	P                  P                  pV	P                  P!                  R^4      ^,          P#                  RR4      p\        P                  ! V RV R24       Kj  	  K  	  R# R# )z
List connected YubiKeys.
rc   rd   r9   + [z] <access denied>N)r   r?   r@   rg   rA   Zsetr   rZ   r]   ZaddrO   r   rr   r5   yubikey_typerE   r   r   )rC   ZserialsrT   rS   ZpidsrU   ra   rn   r9   rO   Zcountrg   modes   &&&          r;   r   r   $  s/    "nFJJv{{# %
 5D)+

8??+JJ /4<OOOYx/0M 	 , .**,JCuA++11D88>>#q1!4<<S#FDJJ$r$/@AB & ' r=   c                 s>   V P                   f   \        R4      h\        WP                   P                  4      pV RVP                   R2pV'       dK   V P                   P
                  P                  R^4      ^,          P                  RR4      pVRV R2,          pV# )NzPID is Nonez (Z)r9   r   r   Z])rO   ZAssertionErrorr   r   Zversion_namerg   r   r   )rU   ra   Zinclude_moderg   rt   r   s   &&&   r;   r]   r]   P  s    
ww]++Hgg223DF"X22315Kww||!!#q)!,44S#>D6|#r=   c                   s0   a  ] tR tRt o RR ltR tRtV tR# )_DefaultFormatterio  c                s    Wn         R # rf   
show_trace)selfr   s   &&r;   __init__Z_DefaultFormatter.__init__p  s    $r=   c                s    VP                    R VP                  4        2pV P                  '       d4   VP                  '       d"   W P	                  VP                  4      ,          pV# )z: )Z	levelnameZ
getMessager   r   ZformatException)r   ZrecordZmessages   && r;   formatZ_DefaultFormatter.formats  sP    %%&b):):)<(=>???v++FOO<<Gr=   r   N)F)__name__Z
__module__Z__qualname__Z__firstlineno__r   r   Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r;   r   r   o  s     % r=   r   c                  s   \         P                  ! 4       p V P                  \         P                  4       \	        4       pV P                  V4       \         P                  ! 4       P                  V 4        R \        P                  \        P                  P                  R4      &    \        P                  P                  R4      pV^8  d   \        P                  P                  V4      p\        P                  P                  V4      p\        P                  P                  ^V4       \        P                  P                  ^V4        \        / RR7       R#   \         d     Li ; i  \         d     L.i ; i  \         d   p^p\!        T\"        4      '       d!   TP$                  pTP&                  ^ ,          pM<\!        T\(        4      '       d   RpM#\!        T\        4      '       d   T pM	RpRTn        \,        P/                  T4       \         P0                  ! 4        \        P2                  ! T4        Rp?R# Rp?ii ; i)	r4   r{   rp   F)r   Zwindows_expand_argsz\The functionality required for this command is not enabled or not available on this YubiKey.z An unexpected error has occurredTN)loggingZStreamHandlerZsetLevelZWARNINGr   ZsetFormatter	getLoggerZ
addHandlersysargvindexrP   r\   Zinsertr   rQ   Z
isinstancer+   statusr`   r   r   r   Z	exceptionZshutdownrA   )ZhandlerZ	formatterr   ZargZvalr   r   Zmsgs           r;   mainr   z  s   ##%GW__%!#I#""7+2:./
z*19((,,u%C((,,u%CHHOOAs#HHOOAs#.!    
  a!!XXF&&)C788-  :&&CC4C#'I #s>   50E &B$E+ E< E('E(+E98E9<IB4IIZ__main__)
   r    iG  )r   rf   )r    r    )T)nZctypesr   r   r   r6   Zdataclassesr   r?   Zclick.shell_completionZcryptography.exceptionsr   Zyubikit.corer   r   Zyubikit.core.fidor   Zyubikit.core.otpr   Zyubikit.core.smartcardr   Zyubikit.core.smartcard.scpr   r	   r
   r   Zyubikit.loggingr   Zyubikit.managementr   Zyubikit.supportr   r   rd   r   r   r   rY   r   Zdiagnosticsr   r   r   Zpcscr   rM   r   Zsettingsr   Zutilr   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   Zscriptr'   r*   r(   r)   r+   r,   r-   r.   r/   r0   r1   r2   r3   r   r   r   ZdictZCLICK_CONTEXT_SETTINGSZplatformr   ZwindllZshell32ZIsUserAnAdminrl   r<   rG   rJ   rW   ro   ZoptionZintr   r   ZNOTSETr[   Zpass_contextr   Zcommandr   r]   r   ZcmdZadd_commandZ	Formatterr   r   r   r=   r;   <module>r      s1  8   	 
     4 H , * 6  & + /  : ! 3 " ,              P P
 
 
 
		8	$ x0@TWX  LLG 0 0&&446770 0/ =-: <
~ 45		B 
,
 	D		G	 

_.	/ (	A	 		
(	=	 
1
 	J 	Iy'7'7&8	9	2 		Q 	B 	1 	8	 I: 
		
 6ZI:X V
/	 dK4WXC  Y CD 
  COOC )) -` zF r=   