+
    :i  c                   sN   ^ RI t^ RIt^ RIt^ RIHtHt ^ RIHtH	t	 ^ RI
t
^ RIHtHt ^ RIHt ^ RIHtHtHtHtHtHt ^ RIHt ^ RIHtHt ^ R	IHtHt ^ R
IH t  ^RI!H"t" ^RI#H$t$H%t%H&t&H't' ^RI(H)t)H*t*H+t+H,t,H-t-H.t.H/t/H0t0H1t1 ]Pd                  ! ]34      t4]+! ]].R7      ]
Pj                  ],R 4       4       4       t#]#Pm                  4       ]
Pj                  R 4       4       t7R t8]#Pm                  R4      ]*]
Pj                  R 4       4       4       t9R\R R llt:]#Pw                  R4      R 4       t<]<Pm                  R4      ]
Pj                  ]
Pz                  ! RRRR7      ]
Pz                  ! RRRR7      ]
Pz                  ! R R!R"R#R$7      R% 4       4       4       4       4       t>R]R& lt?]<Pm                  R'4      ]
Pj                  ]
Pz                  ! RRRR7      R( 4       4       4       t@R) tA]<Pm                  R*4      ]
Pj                  ]
Pz                  ! RRR+R7      R, 4       4       4       tB]<Pm                  R-4      ]
Pj                  ]
Pz                  ! RRR+R7      ]
Pz                  ! R.R/R"R0R17      ]
P                  ! R2]
P                  ! ^^?4      R37      R4 4       4       4       4       4       tER^R5 ltFR6 tGR7 R8 ltHR9 tI]#Pw                  R:4      R; 4       tJR< tK]JPm                  R=4      ]
Pj                  ]
Pz                  ! RRR+R7      ]
Pz                  ! R>R?R"R@R$7      RA 4       4       4       4       tL]JPm                  RB4      ]
Pj                  ]
P                  ! RC4      ]
Pz                  ! RRR+R7      ]
Pz                  ! RDRER"RFR$7      RG 4       4       4       4       4       tM]#Pw                  RH4      RI 4       tNRJ tORK tP]NPm                  R=4      ]
Pj                  ]
Pz                  ! RRR+R7      RL 4       4       4       tQ]NPm                  RM4      ]
Pj                  ]
P                  ! RN4      ]
Pz                  ! RRR+R7      RO 4       4       4       4       tR]NPm                  RP4      ]
Pj                  ]
P                  ! RQRRRS7      ]
P                  ! RN4      ]
Pz                  ! RRR+R7      RT 4       4       4       4       4       tS]NPm                  RB4      ]
Pj                  ]
P                  ! RQRRRS7      ]
Pz                  ! RRR+R7      ]
Pz                  ! RDRER"RFR$7      RU 4       4       4       4       4       tT]#Pw                  RV4      RW 4       tU]UPm                  RX4      ]
Pj                  ]
Pz                  ! RRR+R7      RY 4       4       4       tV]UPm                  RZ4      ]
Pj                  ]
Pz                  ! RRR+R7      R[ 4       4       4       tWR# )_    Nasdictreplace)NoReturnSequence)STATUS	CtapError)	ApduError)CaptureError	ClientPinConfigCredentialManagementCtap2FPBioEnrollment)	TRANSPORT)FidoConnectionSmartCardCtapDevice)SWSmartCardConnection)
CAPABILITY)REINSERT_STATUS)fips_change_pin
fips_resetfips_verify_pinis_in_fips_mode)	CliFailclick_force_optionclick_groupclick_postpone_executionclick_promptis_yk4_fipspretty_printprompt_for_touchprompt_timeout)Zconnectionsc                s  a  S P                   R,          pS P                   R,          pS P                   P                  R4      pV'       d9   VP                  \        4      pV! V4      pVS P                   R&   \	        WE4      pMVP                  \        4      '       d   VP                  \        4      pMVP                  \        4      '       dj   VP                  \        P                  8X  dK   VP                  P                  VP                  ,          R,          '       d   VP                  \        4      pM\        R4      hVS P                   R&   S P                  V 3R l4       \        P                  VP                  P                  VP                  ,          9   d   \!        V4      S P                   R	&   R# \        P                  VP"                  VP                  ,          9   p\$        P'                  R
V 24       S P(                  R8X  d   R# S P(                  R8X  d   \+        V4      '       d   R# V'       d   \        R4      h\        R4      h)z
Manage the FIDO applications.

Examples:


  Reset the FIDO (FIDO2 and U2F) applications:
  $ ykman fido reset


  Change the FIDO2 PIN from 123456 to 654321:
  $ ykman fido access change-pin --pin 123456 --new-pin 654321

deviceinfoZscp
scp_paramsi   zUnsupported connection typeconnc                  sF   < S P                   R ,          P                  4       # )r&   )objclose)ctxs   4/usr/lib/python3.14/site-packages/ykman/_cli/fido.pyZ<lambda>Zfido.<locals>.<lambda>q   s    cggfo335    ctap2zCTAP2 not enabled, supported: NresetzIFIDO2 has been disabled on this YubiKey. Use 'ykman config' to enable it.z$This YubiKey does not support FIDO2.)r'   getopen_connectionr   r   Zsupports_connectionr   	transportr   USBconfigenabled_capabilitiesr   Zcall_on_closer   FIDO2r   supported_capabilitiesloggerdebugZinvoked_subcommandr   )r)   devr$   Zresolve_scpZs_connr%   r&   	supporteds   f       r*   fidor:   I   s   $ ''(
C776?D''++e$K$$%89 (
 *"66		 	 	0	0"">2 344MMY]]*KK,,S]];fDD""#67344CGGFO564;;;;CMMJJ ;$$(C(CCMM(RR	5i[AB!!V+!!W,T1B1B 3 
 @AAr+   c                sH   V P                   R,          pV P                   P                  R4      p/ pV.p\        P                  VP                  9   d"   \        P                  VP
                  9   VR&   M0\        V4      '       d    \        V P                   R,          4      VR&   V'       Ed   VP                  P                  '       d#   \        VP                  P                  4      VR&   \        V4      pVP                  P                  R,          '       dp   VP                  P                  '       d   VP                  R4       VP                  4       w  rgV'       d#   V R2VR	&   V'       d   VP                  R
4       MRVR	&   MRVR	&   VP                  P                   VR&   VP                  P                  P                  R4      pV'       d)   VP#                  4       p	V	'       d   RV	 R2VR&   MRVR&   MVRJ d   RVR&   VP                  P                  P                  R4      p
V
e   V
'       d   RMRVR&   VP                  P$                  pVe   WR&   VP                  P                  P                  R4      pVe   V'       d   RMRVR&   M_V P                   R,          p\        P                  VP&                  VP(                  ,          9   pV'       d   RMRVR &   V'       d   RMRVR	&   \*        P,                  ! R!P/                  \1        V4      4      4       R# )"z2
Display general status of the FIDO2 application.
r$   r,   zFIPS approvedr&   ZAAGUID	clientPinzINOTE: The FIDO PIN is disabled and must be changed before it can be used!z attempt(s) remainingPINzHPIN is temporarily blocked. Remove and re-insert the YubiKey to unblock.ZBlockedzNot setzMinimum PIN length	bioEnrollzRegistered, ZFingerprintsz)Registered, blocked until PIN is verifiedFzNot registeredalwaysUvNZOnZOffzAlways Require UVzCredential storage remainingepZEnabledZDisabledzEnterprise Attestationr#   zNot supportedZCTAP2
)r'   r.   r   r4   fips_capableZfips_approvedr   r   r$   Zaaguidstrr
   optionsforce_pin_changeZappendZget_pin_retriesmin_pin_lengthZget_uv_retriesZremaining_disc_credsr5   r0   clickechojoinr    )r)   r$   r,   dataZlines
client_pinZpin_retriesZpower_cycle
bio_enrollZ
uv_retries	always_uvZremaining_credsr?   r8   r9   s   &              r*   r$   r$      s    776?DGGKK ED&E4,,, * 0 0D4F4F F_	T		 / @_u:: !2!23DNu%
::k**zz*** (2'A'A'C$K!,-BCULLG
 (U#DK%*ZZ%>%>!"ZZ''++K8
#224J)5j\AV'W^$'R^$5 #3D JJ&&**:6	 09uD$%**99&3B/0ZZ##D)>:<Y*D)*ggh$$(C(CCMM(RR	&/
_W$-j?U	JJtyye,-.r+   c                 s.    \        \        V R R7      4      # )N)Zenc_identifierr   )r$      &r*   _ctap2_fingerprintrN      s    '$t455r+   r-   c                s*  aaa V P                   R,          p\        P                  VP                  9   d   \	        R4      hV P                   R,          p\        P                  VP
                  P                  VP                  ,          9   d^   V P                   R,          P                  P                  pV'       d/   VP                  V9  d   \	        RRP                  V4       24      hV P                   R,          pVP                  \        P                  8X  d   RpR	oR
oM\        V4      pRoRoV'       g   \        P                  ! RRRR7       V'       d!   \!        RRRR7      pVR8w  d   \	        R4      hVP#                  4        VV3R lpVP%                  VR7       V P                   P'                  R4      p	V	'       d!   \)        VP+                  \,        4      V	4      pMVP+                  \/        V4      4      pWPP                   R&    V'       d(   \1        4       ;_uu_ 4        \3        V4       RRR4       M\5        V4      p
VP6                  fJ   \9        V P                   R,          P                  4      \9        V
P                  4      8w  d   \	        R4      hV
P                  P:                  '       d   RMRoV3R lpV
P=                  VR7       \        P>                  ! R4       R#   + '       g   i     L(; i  \@         d   pTPB                  \@        PD                  PF                  8X  d   \	        R4      hTPB                  \@        PD                  PH                  \@        PD                  PJ                  39   d   \	        R 4      h\	        R!TPB                  PL                   R"24      hRp?i\N         d;   pTPB                  \P        PR                  8X  d   \	        R 4      h\	        R#4      hRp?i\T         d    \	        R#4      hi ; i)$a   
Reset all FIDO applications.

This action will wipe all FIDO credentials, including FIDO U2F credentials,
on the YubiKey and remove the PIN code.

The reset must be triggered immediately after the YubiKey is
inserted, and requires a touch on the YubiKey.
r$   zbCannot perform FIDO reset when PIV is configured, use 'ykman config reset' for full factory reset.r#   r,   zZCannot perform FIDO reset on this YubiKey over the current transport. Allowed transports: z, r&   Fz(Remove your YubiKey from the NFC reader.z0Place your YubiKey back on the NFC reader now...z&Remove your YubiKey from the USB port.zRe-insert your YubiKey now...zvWARNING! This will delete all FIDO credentials, including FIDO U2F credentials, and restore factory settings. Proceed?T)ZerrZabortzWARNING! This is a YubiKey FIPS (4 Series) device. This command will also overwrite the U2F attestation key; this action cannot be undone and this YubiKey will no longer be a FIPS compliant device.
To proceed, enter the text "OVERWRITE" )ZdefaultZshow_defaultZ	OVERWRITEzReset aborted by user.c                 s   < T ;\         P                  8X  d    \        P                  ! S4       R # \         P                  8X  d   \        P                  ! S4       R # R # N)r   ZREMOVErF   rG   ZREINSERT)status
insert_msg
remove_msg   &r*   prompt_reinsertZreset.<locals>.prompt_reinsert  s7    +_++JJz*$--JJz* .r+   )Zreinsert_cbr%   Nz0Inserted YubiKey does not match the one removed.z;Press and hold the YubiKey button for 5 seconds to confirm.zTouch the YubiKey to confirm.c                 s   < V \         P                  8X  d   \        S4       R# V \         P                  8X  d   \        P
                  ! R 4       R# R# )z.Reset in progress, DO NOT REMOVE YOUR YUBIKEY!N)r   ZUPNEEDEDr!   Z
PROCESSINGrF   rG   )rQ   	touch_msgs   &r*   on_keepaliveZreset.<locals>.on_keepalive7  s7    V__,$Y/v000JJOP 1r+   )rW   zFIDO application data reset.zBReset failed. You need to touch your YubiKey to confirm the reset.zUReset failed. Reset must be triggered within 5 seconds after the YubiKey is inserted.zReset failed: .zReset failed.)+r'   r   r4   Zreset_blockedr   r2   r3   r0   r$   Ztransports_for_resetrH   r   ZNFCr   rF   confirmr   r(   Zreinsertr.   r   r/   r   typer"   r   r   ZserialrN   Zlong_touch_for_resetr-   rG   r   codeERRZACTION_TIMEOUTZNOT_ALLOWEDPIN_AUTH_BLOCKEDnamer   r   COMMAND_NOT_ALLOWEDZ	Exception)r)   forcer$   r8   Z
transportsr&   is_fipsZdestroy_inputrU   r%   r,   rW   erR   rS   rV   s   &&           @@@r*   r-   r-      sP    776?D4---?
 	

 ''(
C4;;;;CMMJJWWW%**??
#--z9''+yy'<&=? 
 776?D
}}	%?
G
 d#=
4
B		
 (9 "M +677

	+ 	1 WW[[.
&##$78*D &&tDz2D/'!!4  "! $KE{{"%cggg&6&;&;<@RJJA  ""TUU ::222 N4 Q KK\K2

12/ "!0  ;66Y]]111T  VV	119==3Q3QRR' 
 N166;;-q9:: +66R+++' 
 /** 'o&&'sV   L L +K27BL >2L 2L	=L PB%N55PP5O88PPc                s$    V ^8  d   QhR\         /# )   return)r   Zformat   "r*   __annotate__rg   W  s     
& 
&8 
&r+   c                 sp   VP                   \        P                  P                  8X  d   \	        R 4      hVP                   \        P                  P
                  8X  d   \	        R4      hVP                   \        P                  P                  8X  d   \	        R4      h\	        W!P                   ,          4      h)
Wrong PIN.zJPIN authentication is currently blocked. Remove and re-insert the YubiKey.PIN is blocked.)r[   r   r\   ZPIN_INVALIDr   r]   ZPIN_BLOCKED)r)   rb   Zother   &&&r*   _fail_pin_errorrk   W  s~    vv***l##	
9==11	1X
 	
 
9==,,	,'((effn%%r+   accessc                     R# )z
Manage the PIN for FIDO.
N rn   r+   r*   rl   rl   d      r+   z
change-pinz-Pz--pinzcurrent PIN code)helpz-nz	--new-pinz	a new PINz-uz--u2fTz9set FIDO U2F PIN instead of FIDO2 PIN (YubiKey FIPS only))Zis_flagrp   c                s  aaaaaa V P                   R,          p\        V4      pV'       d   V'       g   \        R4      hV'       d   V'       g   \        R4      hV'       d$   V P                   R,          o^o^ oVVV3R lpTpEMV P                   P                  R4      pV'       g   \        R4      h\	        V4      oVP
                  P                  oVP
                  P                  oVP                  '       dA   \        P                  VP                  P                  \        P                  ,          9   d   ^oVP
                  P                  P                  R4      '       d   S'       g   \!        4       oVV3R	 lp	T	pMS'       d   \        R
4      hSP"                  pRVV3R lloV'       g   \%        RRRR7      pS! VR4        V! V4       \8        P:                  ! R4       R#   \&         dK   p
T
P(                  \&        P*                  P,                  8X  d   \        R4      h\/        Y
R4        Rp
?
LhRp
?
i\0         dt   p
T
P(                  \2        P4                  8X  d   \        R4      hT
P(                  \2        P6                  8X  d   \        R4      h\        RT
P(                  R R24      hRp
?
ii ; i)a$  
Set or change the PIN code.

The FIDO2 PIN must be at least 4 characters long, and supports any type of
alphanumeric characters. Some YubiKeys can be configured to require a longer
PIN.

On YubiKey FIPS (4 Series), a PIN can be set for FIDO U2F. That PIN must be at least
6 characters long.
r$   zMThis is a YubiKey FIPS (4 Series). To set the U2F PIN, pass the --u2f option.zThis is not a YubiKey FIPS (4 Series), and therefore does not support a U2F PIN. To set the FIDO2 PIN, remove the --u2f option.r&   c                 s   < S;'       g    R p \        SW4       R#   \         dJ   pTP                  \        P                  8X  d%   \        4       pS! T4       \        SY4        Rp?R# h Rp?ii ; i)rO   N)r   r   r[   r   ZWRONG_LENGTH_prompt_current_pin)new_pinZfips_pinrb   _fail_if_not_valid_pinr&   pins   &  r*   _fips_change_pinZ$change_pin.<locals>._fips_change_pin  s]    yybH	h8 66R__,24H*84#D(<<s    A1=A,+A,,A1r,   z%PIN is not supported on this YubiKey.r;   c                 s,   < SP                  SV 4       R # rP   )
change_pin)rr   rJ   rt   rT   r*   _ctap2_change_pinZ%change_pin.<locals>._ctap2_change_pin  s    %%c73r+   z6There is no current PIN set. Use --new-pin to set one.Nc                 s   < V '       d   \        V 4      S8  d   \        V R S R24      h\        V 4      S8  d   \        V RS R24      hR# )z must be at least z characters long.z must be at most N)lenr   )rt   r^   max_lenmin_lens   &&r*   rs   Z*change_pin.<locals>._fail_if_not_valid_pin  sV    c#h(TF"4WI=NOPPs8gTF"3G9<MNOO r+   zEnter your new PINT)
hide_inputZconfirmation_promptzNew PINz-New PIN doesn't meet complexity requirements.zFailed to change PIN: %s.rh   ri   zFailed to change PIN: SW=04xrX   zFIDO PIN updated.)Nr<   )r'   r   r   r.   r
   r$   rE   Zmax_pin_length_is_bior   PIVr2   r3   r   r1   rC   rq   Zset_pinr   r   r[   r\   ZPIN_POLICY_VIOLATIONrk   r   r   VERIFY_FAIL_NO_RETRYAUTH_METHOD_BLOCKEDrF   rG   )r)   rt   rr   Zu2fr$   ra   ru   Z	do_changer,   rw   rb   rs   rJ   r&   ry   rz   s   &f&&       @@@@@r*   rv   rv   k  s*   , 776?D$Gs9
 	

 7F
 	

 wwv	 %	 G$ABBu%
**++**++LLL$++"B"B9=="QQG::!!+..)+4 *IVWW"**IP P   $

 7I.E' 
JJ"#  A66Y]]777IJJC$?@@ E66R,,,,''VVr---+,,5affS\CDDEs,   G, ,J=7A H<<J=	J=
A.J88J=c                 sH   V P                   P                  R 4      pV'       g   \        V R24      hVP                  P                  P                  R4      '       g   \        V R24      hVP                  P
                  '       d   \        R4      hVf   \        RR7      pV# )r,   z" is not supported on this YubiKey.r;   z( requires having a PIN. Set a PIN first.z.The FIDO PIN is blocked. Change the PIN first.zEnter your PINZprompt)r'   r.   r   r$   rC   rD   rq   )r)   rt   Zfeaturer,   s   &&& r*   _require_pinr     s    GGKK E	!CDEE::!!+..	!IJKKzz"""FGG
{!)9:Jr+   z
verify-pinc                s0   V P                   P                  R4      pV'       dD   \        W4      p\        V4      p VP	                  V\        P
                  P                  R4       ML\        V P                   R,          4      '       d     \        V P                   R,          V4       M\        R4      h\"        P$                  ! R4       R#   \         d   p\        RT R24      hRp?ii ; i  \         d   pTP                  \        P                  8X  d   \        R4      hTP                  \        P                  8X  d   \        R	4      hTP                  \        P                   8X  d   \        R
4      h\        RTP                  R R24      hRp?ii ; i)z
Verify the FIDO PIN against a YubiKey.

For YubiKeys supporting FIDO2 this will reset the "retries" counter of the PIN.
For YubiKey FIPS (4 Series) this will unlock the session, allowing U2F registration.
r,   zykman.example.comzPIN verification failed: rX   Nr$   r&   rh   ri   zPIN is not set.r|   z)This YubiKey does not support a FIDO PIN.zPIN verified.)r'   r.   r   r
   get_pin_token
PERMISSIONZGET_ASSERTIONr   r   r   r   r   r[   r   r   r   r_   rF   rG   )r)   rt   r,   rJ   rb      &&   r*   verifyr     sI    GGKK E3$u%
	<$$Y))779L
 
SWWV_	%	%
	ICGGFOS1 ABB	JJ!  	<5aS:;;	<
  	Ivv000l++2111/002111/00 9!&&QGHH	Is0   +C 
C- C*C%%C*-F8BFFc                 s   V P                   P                  R 4      p\        P                  ! VP                  4      '       g   \        R4      hRpRpVP                  P                  P                  R4      '       dO   \        WR4      p\        V4      p VP                  pVP                  V\        P                  P                  4      p\        W#V4      #   \         d   p\        YR4        Rp?L(Rp?ii ; i)r,   z=Authenticator Configuration is not supported on this YubiKey.Nr;   zAuthenticator ConfigurationPIN error: %s.)r'   r.   r   Zis_supportedr$   r   rC   r   r
   protocolr   r   ZAUTHENTICATOR_CFGr   rk   )r)   rt   r,   r   tokenrJ   rb   s   &&     r*   _init_configr     s    GGKK Euzz**UVVHEzzk**3%BCu%
	6!**H,,Y));;E %5))  	6C$455	6s   6C C7!C22C7zforce-changezPIN codec                sp   RV P                   9   d(   V P                   R,          P                  P                  MRpVe   VP                  R4      '       g   \	        R4      hVP                  R4      '       g   \	        R4      h\        W4      pVP                  RR7       \        P                  ! R	4       R# )
z8
Force the PIN to be changed to a new value before use.
r,   NsetMinPINLengthz2Force change PIN is not supported on this YubiKey.r;   zNo PIN is set.T)Zforce_change_pinzForce PIN change set.)	r'   r$   rC   r.   r   r   set_min_pin_lengthrF   rG   r)   rt   rC   r2      &&  r*   rD   rD   '  s     07#''/Acggg##++tGgkk*;<<JKK;;{##&''##F
t4	JJ&'r+   zset-min-lengthz-Rz--rp-idzRP ID to allow)Zmultiplerp   length)rZ   c                s   RV P                   9   d   V P                   R,          P                  MRpVe"   VP                  P                  R4      '       g   \	        R4      hVP                  P                  R4      '       d-   VP                  P                  R4      '       g   \	        R4      hVP
                  pW58  d   \	        RV R	24      hV P                   R
,          pVP                  '       dQ   \        P                  VP                  P                  \        P                  ,          9   d   V^8  d   \	        R4      h\        W4      pV'       d]   V P                   P                  R4      pVP                  P                  p	\        V4      V	8  d   \	        RV	 R\        V4       R24      hVP!                  W2R7       \"        P$                  ! R4       R# )z
Set the minimum length allowed for PIN.

Optionally use the --rp-id option to specify which RPs are allowed to request this
information.
r,   Nr   z8Set minimum PIN length is not supported on this YubiKey.r>   r;   zISetting min PIN length requires a PIN to be set when alwaysUv is enabled.z1Cannot set a minimum length that is shorter than rX   r$   z2Cannot set a minimum length that is longer than 8.zAuthenticator supports up to z	 RP IDs (z given).)rE   Zrp_idszMinimum PIN length set.)r'   r$   rC   r.   r   rE   r}   r   r~   r2   r3   r   r1   r   Zmax_rpids_for_min_pinrx   r   rF   rG   )
r)   rt   rp_idr   r$   rz   Zdev_infor2   r,   Zcaps
   &&&&      r*   r   r   9  su    %,sww$63777  DD|4<<++,=>>PQQ||
##DLL,<,<[,I,IW
 	
 !!GI'RSTUUwwvHNNhooBB9==QQQJJKK##FG$jj..u:/uIc%j\R  VB	JJ()r+   c                 s    \        V R R7      # )T)r{   )r   r   rM   r*   rq   rq   f  s    400r+   c           
   #   s  "   V P                  4       pVP                  \        P                  P                  4      ^ 8X  d   R# V P                  4        EF  pV P                  V\        P                  P                  ,          4       F  pV\        P                  P                  ,          R,          V\        P                  P                  ,          V\        P                  P                  ,          R,          V\        P                  P                  ,          P                  RR4      V\        P                  P                  ,          P                  RR4      3x  K  	  EK  	  R# 5i)r    Nidr^   rO   ZdisplayName)Zget_metadatar.   r   ZRESULTZEXISTING_CRED_COUNTZenumerate_rpsZenumerate_credsZ
RP_ID_HASHZRPZCREDENTIAL_IDZUSER)credmanrI   ZrpZcreds   &   r*   
_gen_credsr   j  s    !Dxx$++??@AE##%++B/C/J/J/U/U,VWD'..11248)00>>?)00556t<)00556::62F)00556::="M  X &s   E%E'c                s~    V ^8  d   QhR\         \        ,          R\        \         \        ,          ,          R\        /# )rc   headingsrowsrd   )r   rB   listre   rf   r*   rg   rg   y  s.     < <HSM <hsm1D < <r+   c           	      s   a	 V .V,           pV UUu. uF  q3 Uu. uF  pR NK  	  upNK  	  ppp\        R V 4       4      p\        V4       F  o	\        V	3R lV 4       4      p\        \        V4      4       F^  pS	\        W(,          4      8  g   K  W(,          S	,          RV\        W(,          S	,          4      ,
          ,          ,           WX,          S	&   K`  	  K  	  RP                  R V 4       4      # u upi u uppi )rO   c              3   s8   "   T F  p\        V4      x  K  	  R # 5irP   rx   .0row   & r*   	<genexpr> _format_table.<locals>.<genexpr>}  s     0x3s88xs   c              3   sl   <"   T F)  p\        V4      S8  g   K  \        VS,          4      x  K+  	  R # 5irP   r   )r   r   c   & r*   r   r     s'     Hx3s8a<CFxs   44 r@   c              3   sD   "   T F  pR P                  V4      x  K  	  R# 5i)z  N)rH   r   r   r*   r   r     s     ;{TYYs^^{s    )ZmaxZrangerx   rH   )
r   r   Zall_rowsr   ZcellZpadded_rowsZmax_colsZ	max_widthZrr   s
   &&       @r*   _format_tabler   y  s    zD H3;<8C3'34B3'8K<0x00H8_HxHH	s8}%A3x{##$,KN9s8;q>'::;%q! &  99;{;;; (<s   C:C5C:5C:c                 s2    V  R VP                  4        R V 2# )r   hex)r   user_id	user_namerj   r*   _format_credr     s    WAgkkm_Ai[11r+   Zcredentialsc                 rm   )a  
Manage discoverable (resident) credentials.

This command lets you manage credentials stored on your YubiKey.
Credential management is only available when a FIDO PIN is set on the YubiKey.


Examples:


  List credentials (providing PIN via argument):
  $ ykman fido credentials list --pin 123456


  Delete a credential (ID shown in "list" output, PIN will be prompted for):
  $ ykman fido credentials delete da7fdc
Nrn   rn   r+   r*   credsr     ro   r+   c                 s0   \        WR 4      pV P                  P                  R4      p\        V4      p VP	                  V\        P
                  P                  4      p\        W#P                  X4      #   \         d   p\        YR4        Rp?L2Rp?ii ; i)zCredential Managementr,   r   N)r   r'   r.   r
   r   r   ZCREDENTIAL_MGMTr   rk   r   r   r)   rt   r,   rJ   r   rb      &&    r*   _init_credmanr     s    
s!8
9CGGKK E5!J2((i.B.B.R.RS  ':':EBB  2 0112s   *A4 4B?BBr   z-cz--csvz)output full credential information as CSVc                s  a \        W4      p\        \        V4      4      pV'       d}   \        P                  ! 4       p\
        P                  ! V4      pVP                  . RO4       VP                  R V 4       4       \        P                  ! VP                  4       4       R# ^o\        \        V3R lV 4       4      4      \        V4      8  d   S^,          oK7  \        P                  ! \        . ROV UUU	U
Uu. uF+  w  rxrpVR,          RS P                  4       R,           WzV3NK-  	  upp
p	pp4      4       R# u upp
p	ppi )z
List credentials.

Shows a list of credentials stored on the YubiKey.

The --csv flag will output more complete information about each credential,
formatted as a CSV (comma separated values).
c              3   sz   "   T F1  w  rr4pVR ,          P                  4       WWSP                  4       .x  K3  	  R# 5i)r   Nr   )r   r   cred_idr   r   display_names   &     r*   r   creds_list.<locals>.<genexpr>  s8      
DI@L T] %L++-PDIs   9;c              3   sH   <"   T F  q^,          R,          RS x  K  	  R# 5i)i   r   Nrn   )r   r   lnr   r*   r   r     s     5u!d4j"ous   "r   Nz...)credential_idr   r   Zuser_display_namer   )zCredential IDzRP IDZUsernamezDisplay name)r   r   r   ioZStringIO_csvwriterZwriterowZ	writerowsrF   rG   Zgetvaluerx   Zsetr   r   )r)   rt   csvr   r   Zbufr   r   r   _r   r   r   s   &&&         @r*   
creds_listr     s   $ C%GG$%E
kkmS!S	
 	 
DI
 	
 	

3<<>"#5u556UC!GB

F GLFKBl T]3B'++-5uVFK	
s   >1E Zdeleter   z-fz--forcez"confirm deletion without promptingc                s   \        W4      pVP                  R4      P                  4       p\        V4       UUUUU	u. uF9  w  rVrxp	VR,          P	                  4       P                  V4      '       g   K5  WVW3NK;  	  p
ppppp	\        V
4      ^ 8X  d   \        R4      h\        V
4      ^8X  d   V
^ ,          w  rVrV'       g?   \        P                  ! RV RV RV	 RVR,          P	                  4        R2	4      '       dA    \        P                  ! R4       VP                  V4       \        P                  ! R	4       R# R# \        R4      hu up	ppppi   \         d    \        R
4      hi ; i)z
Delete a credential.

List stored credential IDs using the "list" subcommand.


CREDENTIAL_ID       a unique substring match of a Credential ID
rX   r   zNo matches, nothing to be done.zDelete r    (z)?z0Deleting credential, DO NOT REMOVE YOUR YUBIKEY!zCredential deleted.zFailed to delete credential.z7Multiple matches, make the credential ID more specific.N)r   ZrstripZlowerr   r   Z
startswithrx   r   rF   rY   rG   Zdelete_credr   )r)   r   rt   r`   r   r   r   r   r   r   Zhits   &&&&       r*   creds_deleter     sK    C%G!((-335M =Gw<O<O8UQ<4=))-8 	21<O 	 
 4yA~788	Ta48G1EMMeWAi[,r'$-:K:K:M9NbQ
 
>

MN##G,

01
 OPP'   ><==>s   2E3E?=E E+Zfingerprintsc                 rm   )a  
Manage fingerprints.

Requires a YubiKey with fingerprint sensor.
Fingerprint management is only available when a FIDO PIN is set on the YubiKey.


Examples:


  Register a new fingerprint (providing PIN via argument):
  $ ykman fido fingerprints add "Left thumb" --pin 123456


  List already stored fingerprints (providing PIN via argument):
  $ ykman fido fingerprints list --pin 123456


  Delete a stored fingerprint with ID "f691" (PIN will be prompted for):
  $ ykman fido fingerprints delete f691

Nrn   rn   r+   r*   bior     ro   r+   c                 s   V P                   P                  R 4      pV'       d   RVP                  P                  9  d   \	        R4      h\        WR4      p\        V4      p VP                  V\        P                  P                  4      p\        W#P                  X4      #   \         d   p\        YR4        Rp?L2Rp?ii ; i)r,   r=   z,Biometrics is not supported on this YubiKey.Z
Biometricsr   N)r'   r.   r$   rC   r   r   r
   r   r   Z
BIO_ENROLLr   rk   r   r   r   r   r*   	_init_bior     s    GGKK EKuzz'9'99DEE
s
.C5!J2((i.B.B.M.MN 5"5"5u==  2 0112s   "*B" "C-B>>Cc                 sJ    V P                  4        V'       d	   R V R2 2# R 2# )r   Z)rO   r   )template_idr^   s   &&r*   
_format_fpr   -  s/    oo 2dV1 >??2 >??r+   c                s    \        W4      pVP                  4       P                  4        F'  w  r4\        P                  ! R\        W44       24       K)  	  R# )zS
List registered fingerprints.

Lists fingerprints by ID and (if available) label.
zID: N)r   enumerate_enrollmentsZitemsrF   rG   r   )r)   rt   r   Zt_idr^   r   r*   bio_listr   1  sE     C
C//1779


T*T0123 :r+   Zaddr^   c                s   \        VP                  4       4      ^8  d   V P                  R4       \        W4      pVP	                  4       pRpVfY   \
        P                  ! R4        VP                  4       pVP                  pV'       d   \
        P                  ! V R24       KZ  K\  \        P'                  R4       \
        P                  ! R4       VP)                  WQ4       \        P'                  R4       R#   \         dD   p\        P                  RTP                   24       \
        P                  ! R4        Rp?K  Rp?i\         d   pTP                  \        P                  P                  8X  d   \!        R4      hTP                  \        P                  P"                  8X  d   \!        R4      h\!        R	TP                  P$                   R
24      hRp?ii ; i)zd
Add a new fingerprint.


NAME        a short readable name for the fingerprint (eg. "Left thumb")
z3Fingerprint name must be a maximum of 15 charactersNz+Place your finger against the sensor now...z more scans needed.zCapture error: z5Capture failed. Re-center your finger, and try again.zJFingerprint storage full. Remove some fingerprints before adding new ones.z1Failed to add fingerprint due to user inactivity.zFailed to add fingerprint: rX   zFingerprint template registeredzCapture complete.zFingerprint template name set)rx   encodefailr   ZenrollrF   rG   Zcapture	remainingr	   r6   r7   r[   r   r\   ZFP_DATABASE_FULLr   ZUSER_ACTION_TIMEOUTr^   r$   set_name)r)   r^   rt   r   Zenrollerr   r   rb   s   &&&     r*   rK   rK   @  sp    4;;=BFG
C
Czz|HK



@A	H"**,K **I

i[(;<=  KK12	JJ"#LL#
KK/0  	PLL?166(34JJNOO 	Hvv777G  9==<<<QRR7}AFGG	Hs1   (#C< C< <G#8EG#G#BGG#Zrenamer   ZID)Zmetavarc                s<   \        VP                  4       4      ^8  d   V P                  R4       \        W4      pVP	                  4       p\
        P                  V4      pWe9  d   \        RV R24      hVP                  Wb4       \        P                  ! R4       R# )z
Set the label for a fingerprint.


ID          the ID of the fingerprint to rename (as shown in "list")
NAME        a short readable name for the fingerprint (eg. "Left thumb")
z.Fingerprint name must be a maximum of 15 bytesNo fingerprint matching ID=rX   zFingerprint template renamed.N)rx   r   r   r   r   bytesfromhexr   r   rF   rG   )r)   r   r^   rt   r   enrollmentskeys   &&&&   r*   
bio_renamer   j  s~     4;;=RAB
C
C++-K
--
$C
3K=BCCLL	JJ./r+   c                s   \        W4      pVP                  4       p \        P                  V4      pV'       d   We9  dh   V Uu. uF  quV,          V8X  g   K  VNK  	  pp\        V4      ^ 8X  d   \        RV R24      h\        V4      ^8  d   \        RV R24      hV^ ,          pWV,          p	V'       g*   \        P                  ! R\        Wi4       R24      '       d+    VP                  V4       \        P                  ! R4       R# R#   \         d    Rp Li ; iu upi   \         d)   p
\        R	T
P                  P                   R24      hRp
?
ii ; i)
z}
Delete a fingerprint.

Delete a fingerprint from the YubiKey by its ID, which can be seen by running the
"list" subcommand.
Nr   rX   zMultiple matches for NAME=z . Delete by template ID instead.zDelete fingerprint Z?zFingerprint template deleted.zFailed to delete fingerprint: )r   r   r   r   Z
ValueErrorrx   r   rF   rY   r   Zremove_enrollmentrG   r   r[   r^   )r)   r   rt   r`   r   r   r   ZkZmatchesr^   rb   r   r*   
bio_deleter     sJ    C
C++-K!MM+6 #()Kk^{-J11kKw<17}AFGG\A,[M :1 1  ajD 3Js4I3J!LMM	K!!#&JJ67 N!  
 L  	K:166;;-qIJJ	Ks5   D DD!'D$ DD$E/#EEr2   c                 rm   )z
Manage FIDO configuration.
Nrn   rn   r+   r*   r2   r2     ro   r+   ztoggle-always-uvc                s   RV P                   9   d0   V P                   P                  R4      P                  P                  MRpV'       d   RV9  d   \	        R4      hV P                   R,          p\
        P                  VP                  9   d   \	        R4      hVR,          p\        W4      pVP                  4        \        P                  ! RV'       d   RMR	 R
24       R# )z8
Toggles the state of Always Require User Verification.
r,   Nr>   z3Always Require UV is not supported on this YubiKey.r$   z6Always Require UV can not be disabled on this YubiKey.zAlways Require UV is ZoffZonrX   )r'   r.   r$   rC   r   r   r4   rA   r   toggle_always_uvrF   rG   )r)   rt   rC   r$   rL   r2   r   r*   r   r     s     4;cgg3Ecggkk'"''//4Gj/KLL776?D4,,,NOO
#I##F
	JJ&	ut&DAFGr+   zenable-ep-attestationc                s   RV P                   9   d0   V P                   P                  R4      P                  P                  MRpV'       d   RV9  d   \	        R4      hVP                  R4      '       d#   VP                  R4      '       g   \	        R4      h\        W4      pVP                  4        \        P                  ! R4       R# )	zQ
Enables Enterprise Attestation for Authenticators pre-configured to support it.
r,   Nr?   z8Enterprise Attestation is not supported on this YubiKey.r>   r;   zREnabling Enterprise Attestation requires a PIN to be set when alwaysUv is enabled.zEnterprise Attestation enabled.)	r'   r.   r$   rC   r   r   Zenable_enterprise_attestationrF   rG   r   r   r*   enable_ep_attestationr     s     4;cgg3Ecggkk'"''//4Gd')PQQ{{:w{{;'?'?
 	

 ##F
((*	JJ01r+   )z%s)zThis feature)zEnter your current PIN)Xr   r   r   ZloggingZdataclassesr   r   Ztypingr   r   rF   Z
fido2.ctapr   r   Zfido2.ctap1r   Zfido2.ctap2r	   r
   r   r   r   r   Zyubikit.corer   Zyubikit.core.fidor   r   Zyubikit.core.smartcardr   r   Zyubikit.managementr   Zbaser   r:   r   r   r   r   Zutilr   r   r   r   r   r   r    r!   r"   Z	getLoggerZ__name__r6   Zpass_contextZcommandr$   rN   r-   rk   Zgrouprl   Zoptionrv   r   r   r   rD   ZargumentZIntRanger   rq   r   r   r   r   r   r   r   r   r   r   r   rK   r   r   r2   r   r   rn   r+   r*   <module>r      s  8  	  ' %  ( !  # A : ) " 
 
 
 
		8	$ .*=>?:B   @:Bz B/  B/J6 g}'   }'@
& H  dG"45dKk2	D	f$ 3 6  f$R
 dG"45!  6  ! H** dG*-( .   (  !dG*-dI3CDu~~a45%* 6 E .  "
%*P1< 2 M (
C vdG*-	4	"
 .  "
J x dG*-dIt2VWQ X . !  
QD N 2>@ VdG*-	4 .  	4 UdG*-#1 .   #1L Xt,dG*-0 .  -  
0, Xt,dG*-dIt2VW!K X . -  
!KH H  "#dG*-H .  $H& '(dG*-2 .  )2r+   