Ë
    €Ï›
  ã                   ó\   — d Z ddlmZ ddlmZ ddlmZ ddlZdd„Zdd„Zd„ Zd	„ Z	d
„ Z
d„ Zy)z#Utilities for OS Login subcommands.é    )Úabsolute_import)Údivision)Úunicode_literalsNc                 óÈ   — |s|j                  | «      }i }|j                  si S |j                  j                  D ]%  }|j                  j                  ||j                  <   Œ' |S )zCReturn a dictionary of fingerprints/keys from the OS Login Profile.)ÚGetLoginProfileÚsshPublicKeysÚadditionalPropertiesÚvalueÚkey)ÚuserÚoslogin_clientÚprofileÚkey_dirÚssh_pub_keys        ú7lib/googlecloudsdk/command_lib/oslogin/oslogin_utils.pyÚGetKeyDictionaryFromProfiler      s`   € á	Ø×,Ñ,¨TÓ2€GØ€'à	×	Ò	Ø€Ià×*Ñ*×?Ô?€kØ*×0Ñ0×4Ñ4€GˆKO‰OÒð @ð 
€.ó    c                 ó¼   — |s|j                  | «      }g }t        |d«      r|j                  sg S |j                  D ]  }|j                  |j                  «       Œ |S )zCReturn a list of 'private' security keys from the OS Login Profile.ÚsecurityKeys)r   Úhasattrr   ÚappendÚ
privateKey)r   r   r   Úsk_listÚsecurity_keys        r   ÚGetSecurityKeysFromProfiler   '   sZ   € á	Ø×,Ñ,¨TÓ2€Gà€'Ü	˜.Ô	)°×1EÒ1EØ€Ià×*Ô*€lØ‡NN<×*Ñ*Õ+ð +ð 
€.r   c                 ój   — |j                  | «      }|j                  r|j                  j                  S y ©N)r   r   r	   )r   r   r   s      r   ÚGetKeysFromProfiler   6   s2   € Ø×*Ñ*¨4Ó0€'Ø×ÒØ× Ñ ×5Ñ5Ð5ð r   c                 óÆ   — |j                  | «      }|r| S | j                  «       }|syt        |«      dk(  r|d   }n|d   }|j                  «       D ]  \  }}||v sŒ|c S  y)zCReturn the fingerprint of an SSH key that matches the key argument.Né   r   )ÚgetÚsplitÚlenÚitems)Úkey_argÚprofile_keysr   Ú	key_splitÚ	key_valueÚfingerprintÚssh_keys          r   ÚFindKeyInKeyListr+   <   ss   € ð 	×Ñ˜Ó!€#ÙØ€Nð m‰m‹o€)Ù	ØÜˆƒ^qÒØ˜!‘Ià˜!‘€Ià*×0Ñ0Ö2Ñ€k7ØGÒØÒñ 3r   c                 óZ   — | sy t        j                   «       }| |z   }t        |dz  «      }|S )Né@B )ÚtimeÚint)ÚttlÚnowÚexpiry_secsÚexpiry_usecss       r   ÚConvertTtlArgToExpiryr4   Q   s1   € Ù	ØÜ	‰	‹€#Øc‘	€+Ü[ 7Ñ*Ó+€,Ø	Ðr   c                 óz   — | sy t        | «      } | dz  }t        j                  dt        j                  |«      «      S )Nr-   z%Y-%m-%dT%H:%M:%SZ)r/   r.   ÚstrftimeÚgmtime)ÚusecÚsecs     r   ÚConvertUsecToRfc3339r:   Z   s5   € Ù	Ø
Ü	ˆT‹€$Øˆw‰€#Ü	‰Ð+¬T¯[©[¸Ó-=Ó	>Ð>r   r   )Ú__doc__Ú
__future__r   r   r   r.   r   r   r   r+   r4   r:   © r   r   Ú<module>r>      s4   ðñ *å &Ý Ý 'ã óóò6òò*ó?r   