+
    üÐj|þ  ã                  óÐ  € R t ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIHtH	t	H
t
 ^ RIHtHt ^ RIHt ^ RI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HtH t H!t!H"t" ^ RI#H$t$H%t%H&t& ^ RI'H(t(H)t) ^ RIH*t* ^ RI+H,t,H-t- ^ RI.H/t/ ^ RI0H1t1 ^ RI2H3t3H4t4 ^ RI5H6t6  ^ RI7H8t8H9t9 R]Pz                  ! 4       R]P|                  ! 4       R]P~                  ! 4       /t@RRRRRR/tA] P„                  tB] P†                  tC ! R R ]D4      tE ! R! R"]D4      tF ! R# R$]D4      tG ! R% R&]D4      tH ! R' R(]4      tI ! R) R*]D4      tJR+ tK ! R, R-4      tLR/R. ltMR#   ]: d    ^ RI7H;t8H<t9  L¼i ; i)0z0
Handling of RSA, DSA, ECDSA, and Ed25519 keys.
)ÚannotationsN)Ú	b64encodeÚdecodebytesÚencodebytes)Úmd5Úsha256)ÚAny)ÚNamedConstantÚNames)Úutils)ÚInvalidSignature)Údefault_backend)ÚhashesÚserialization)ÚdsaÚecÚed25519ÚpaddingÚrsa)ÚCipherÚ
algorithmsÚmodes)Úload_pem_private_keyÚload_ssh_public_key)ÚLiteral)ÚcommonÚsexpy)Úint_to_bytes)Ú	randbytes)Ú	iterbytesÚnativeString)Ú_mutuallyExclusiveArguments)Údecode_dss_signatureÚencode_dss_signature)Údecode_rfc6979_signatureÚencode_rfc6979_signatureó   ecdsa-sha2-nistp256s   ecdsa-sha2-nistp384s   ecdsa-sha2-nistp521s	   secp256r1s   nistp256s	   secp384r1s   nistp384s	   secp521r1s   nistp521c                  ó   € ] tR t^DtRtRtR# )ÚBadKeyErrorz^
Raised when a key isn't what we expected from it.

XXX: we really need to check for bad keys
© N©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__static_attributes__r)   ó    Ú8/usr/lib/python3/dist-packages/twisted/conch/ssh/keys.pyr(   r(   D   s   † õr1   r(   c                  ó   € ] tR t^LtRtRtR# )ÚBadSignatureAlgorithmErrorz]
Raised when a public key signature algorithm name isn't defined for this
public key format.
r)   Nr*   r)   r1   r2   r4   r4   L   ó   † õr1   r4   c                  ó   € ] tR t^StRtRtR# )ÚEncryptedKeyErrorzV
Raised when an encrypted key is presented to fromString/fromFile without
a password.
r)   Nr*   r)   r1   r2   r7   r7   S   r5   r1   r7   c                  ó   € ] tR t^ZtRtRtR# )ÚBadFingerPrintFormatzK
Raises when unsupported fingerprint formats are presented to fingerprint.
r)   Nr*   r)   r1   r2   r9   r9   Z   s   † õr1   r9   c                  ó6   € ] tR t^`tRt]! 4       t]! 4       tRtR# )ÚFingerprintFormatsa¨  
Constants representing the supported formats of key fingerprints.

@cvar MD5_HEX: Named constant representing fingerprint format generated
    using md5[RFC1321] algorithm in hexadecimal encoding.
@type MD5_HEX: L{constantly.NamedConstant}

@cvar SHA256_BASE64: Named constant representing fingerprint format
    generated using sha256[RFC4634] algorithm in base64 encoding
@type SHA256_BASE64: L{constantly.NamedConstant}
r)   N)	r+   r,   r-   r.   r/   r	   ÚMD5_HEXÚSHA256_BASE64r0   r)   r1   r2   r;   r;   `   s   † ñ
ñ ‹o€GÙ!“O„Mr1   r;   c                  ó   € ] tR t^qtRtRtR# )ÚPassphraseNormalizationErrorz€
Raised when a passphrase contains Unicode characters that cannot be
normalized using the available Unicode character database.
r)   Nr*   r)   r1   r2   r?   r?   q   r5   r1   r?   c                ó  € \        V \        4      '       dk   \        ;QJ d    R V  4       F  '       g   K   RM	  RM! R V  4       4      '       d   \        4       h\        P
                  ! RV 4      P                  R4      # V # )a¶  
Normalize a passphrase, which may be Unicode.

If the passphrase is Unicode, this follows the requirements of U{NIST
800-63B, section
5.1.1.2<https://pages.nist.gov/800-63-3/sp800-63b.html#memsecretver>}
for Unicode characters in memorized secrets: it applies the
Normalization Process for Stabilized Strings using NFKC normalization.
The passphrase is then encoded using UTF-8.

@type passphrase: L{bytes} or L{unicode} or L{None}
@param passphrase: The passphrase to normalize.

@return: The normalized passphrase, if any.
@rtype: L{bytes} or L{None}
@raises PassphraseNormalizationError: if the passphrase is Unicode and
cannot be normalized using the available Unicode character database.
c              3  óT   "  € T F  p\         P                  ! V4      R 8H  x € K   	  R# 5i)ÚCnN)ÚunicodedataÚcategory)Ú.0Úcs   & r2   Ú	<genexpr>Ú'_normalizePassphrase.<locals>.<genexpr>Ž   s    é € ÐC¹
°1Œ{×#Ò# AÓ&¨$Ö.»
ùs   ‚&(TFÚNFKCzUTF-8)Ú
isinstanceÚstrÚanyr?   rC   Ú	normalizeÚencode©Ú
passphrases   &r2   Ú_normalizePassphraserQ   x   sc   € ô& �*œc×"Ò"÷ ‹3ÑC¹
ÓC�3�3Š3ÑC¹
ÓC×CÒCô /Ó0Ð0Ü×$Ò$ V¨ZÓ8×?Ñ?ÀÓHÐHàÐr1   c                  óB  € ] tR t^—tRt]R4R l4       t]R4R l4       t]R 4       t]R 4       t	]R 4       t
]R 4       t]R	 4       t]R
 4       t]R 4       t]R 4       t]R 4       t]R 4       t]R5R l4       t]R6R l4       t]R6R l4       t]R6R l4       t]R6R l4       tR tR R ltR R ltR tR t]P:                  3R ltR R ltR t R t!R  t"R! t#R" R# lt$R$ t%R% t&]'! R&R'.R&R(..4      R5R) l4       t(R6R* lt)R4R+ lt*R6R, lt+R7R- lt,R. t-R/ t.R6R0 R1 llt/R2 t0R3t1R# )8ÚKeya]  
An object representing a key.  A key can be either a public or
private key.  A public key can verify a signature; a private key can
create or verify a signature.  To generate a string that can be stored
on disk, use the toString method.  If you have a private key, but want
the string representation of the public key, use Key.public().toString().
Nc                ó¨   € \        VR4      ;_uu_ 4       pV P                  VP                  4       W#4      uuRRR4       #   + '       g   i     R# ; i)aŠ  
Load a key from a file.

@param filename: The path to load key data from.

@type type: L{str} or L{None}
@param type: A string describing the format the key data is in, or
L{None} to attempt detection of the type.

@type passphrase: L{bytes} or L{None}
@param passphrase: The passphrase the key is encrypted with, or L{None}
if there is no encryption.

@rtype: L{Key}
@return: The loaded key.
ÚrbN)ÚopenÚ
fromStringÚread)ÚclsÚfilenameÚtyperP   Úfs   &&&& r2   ÚfromFileÚKey.fromFile    s6   € ô$ �(˜D×!Ô! QØ—>‘> !§&¡&£(¨DÓ=÷ "×!×!Ó!ús   • A Á A	c                ó’  € \        V\        4      '       d   VP                  R4      p\        V4      pVf   V P	                  V4      pVf   \        RV: 24      h\        V RVP                  4        2R4      pVf   \        RV 24      hVP                  P                  ^8X  d   V'       d   \        R4      hV! V4      # V! W4      # )a€  
Return a Key object corresponding to the string data.
type is optionally the type of string, matching a _fromString_*
method.  Otherwise, the _guessStringType() classmethod will be used
to guess a type.  If the key is encrypted, passphrase is used as
the decryption key.

@type data: L{bytes}
@param data: The key data.

@type type: L{str} or L{None}
@param type: A string describing the format the key data is in, or
L{None} to attempt detection of the type.

@type passphrase: L{bytes} or L{None}
@param passphrase: The passphrase the key is encrypted with, or L{None}
if there is no encryption.

@rtype: L{Key}
@return: The loaded key.
úutf-8Nzcannot guess the type of Ú_fromString_zno _fromString method for zkey not encrypted)
rJ   rK   rN   rQ   Ú_guessStringTyper(   ÚgetattrÚupperÚ__code__Úco_argcount)rY   Údatar[   rP   Úmethods   &&&& r2   rW   ÚKey.fromStringµ   s¿   € ô. �dœC× Ò Ø—;‘;˜wÓ'ˆDÜ)¨*Ó5ˆ
ØŠ<Ø×'Ñ'¨Ó-ˆDØŠ<ÜÐ 9¸$¹ÐBÓCÐCÜ˜ ¨T¯Z©Z«\¨NÐ;¸TÓBˆØŠ>ÜÐ :¸4¸&ÐAÓBÐBØ�?‰?×&Ñ&¨!Ô+ßÜ!Ð"5Ó6Ð6Ù˜$“<Ðá˜$Ó+Ð+r1   c                óž  € \         P                  ! V4      w  r#VR8X  dN   \         P                  ! V^4      w  rEpV ! \        P                  ! WE4      P                  \        4       4      4      # VR8X  dg   \         P                  ! V^4      w  rgr‰pV ! \        P                  ! V	\        P                  ! WgVR7      R7      P                  \        4       4      4      # V\        9   dN   V ! \        P                  P                  \        V,          \         P                  ! V^4      ^,          4      4      # VR8X  d9   V P                  \         P                  ! V^4      ^,          RR7      p
RV
n        V
# VR9   dJ   \         P                  ! V4      w  r³V P!                  V4      p
VP#                  R	4      '       d   RV
n        V
# \%        R
V 24      h)a¼  
Return a public key object corresponding to this public key blob.
The format of a RSA public key blob is::
    string 'ssh-rsa'
    integer e
    integer n

The format of a DSA public key blob is::
    string 'ssh-dss'
    integer p
    integer q
    integer g
    integer y

The format of ECDSA-SHA2-* public key blob is::
    string 'ecdsa-sha2-[identifier]'
    integer x
    integer y

    identifier is the standard NIST curve name.

The format of an Ed25519 public key blob is::
    string 'ssh-ed25519'
    string a

@type blob: L{bytes}
@param blob: The key data.

@return: A new key.
@rtype: L{twisted.conch.ssh.keys.Key}
@raises BadKeyError: if the key type (the first string) is unknown.
ó   ssh-rsaó   ssh-dss©ÚpÚqÚg©ÚyÚparameter_numbersó"   sk-ecdsa-sha2-nistp256@openssh.comr&   )ÚencodedPointÚcurveTs   sk-ssh-úunknown blob type: )ó   ssh-ed25519ó   sk-ssh-ed25519@openssh.com)r   ÚgetNSÚgetMPr   ÚRSAPublicNumbersÚ
public_keyr   r   ÚDSAPublicNumbersÚDSAParameterNumbersÚ_curveTabler   ÚEllipticCurvePublicKeyÚfrom_encoded_pointÚ_fromECEncodedPointÚ_skÚ_fromEd25519ComponentsÚ
startswithr(   )rY   ÚblobÚkeyTypeÚrestÚeÚnrn   ro   rp   rr   Ú	keyObjectÚas   &&          r2   Ú_fromString_BLOBÚKey._fromString_BLOBÝ   s’  € ôD Ÿš TÓ*‰ˆØ�jÔ ÜŸš d¨AÓ.‰JˆA�$Ù”s×+Ò+¨AÓ1×<Ñ<¼_Ó=NÓOÓPÐPà�jÔ Ü%Ÿ|š|¨D°!Ó4ÑˆA�!˜ÙÜ×$Ò$Ø¬3×+BÒ+BÀQÈqÔ+Qôç‘*œ_Ó.Ó/óð ð ”kÔ!ÙÜ×)Ñ)×<Ñ<Ü Õ(¬&¯,ª,°t¸QÓ*?ÀÕ*Bóóð ð Ð;Ô;Ø×/Ñ/Ü#Ÿ\š\¨$°Ó2°1Õ5Ø,ð 0ó ˆIð !ˆIŒMØÐàÐEÔEÜ—l’l 4Ó(‰GˆAØ×2Ñ2°1Ó5ˆIØ×!Ñ! *×-Ò-Ø $�	”ØÐäÐ/°¨yÐ9Ó:Ð:r1   c                óÚ  € \         P                  ! V4      w  r#VR8X  d1   \         P                  ! V^4      w  rErgr‰pV P                  WEWhV	R7      # VR8X  d0   \         P                  ! V^4      w  r‰r«rÃV P	                  WºW‰VR7      # V\
        9   d‘   \
        V,          p\         P                  ! V^4      w  répV\        VP                  P                  R4      ,          8w  d   \        RV: RV: 24      h\         P                  ! V4      w  róV P                  W’VR7      # VR	8X  d8   \         P                  ! V^4      w  pppVR
,          pV P                  VVR7      # \        RV 24      h)a  
Return a private key object corresponding to this private key blob.
The blob formats are as follows:

RSA keys::
    string 'ssh-rsa'
    integer n
    integer e
    integer d
    integer u
    integer p
    integer q

DSA keys::
    string 'ssh-dss'
    integer p
    integer q
    integer g
    integer y
    integer x

EC keys::
    string 'ecdsa-sha2-[identifier]'
    string identifier
    string q
    integer privateValue

    identifier is the standard NIST curve name.

Ed25519 keys::
    string 'ssh-ed25519'
    string a
    string k || a


@type blob: L{bytes}
@param blob: The key data.

@return: A new key.
@rtype: L{twisted.conch.ssh.keys.Key}
@raises BadKeyError: if
    * the key type (the first string) is unknown
    * the curve name of an ECDSA key does not match the key type
rk   ©r‹   rŠ   Údrn   ro   rl   ©rr   rp   rn   ro   ÚxÚasciizECDSA curve name z does not match key type )ru   rv   ÚprivateValuerx   :Né    N)Úkrw   )r   rz   r{   Ú_fromRSAComponentsÚ_fromDSAComponentsr€   Ú
_secToNistÚnamerN   r(   rƒ   r…   )rY   r‡   rˆ   r‰   r‹   rŠ   r’   Úurn   ro   rp   rr   r”   rv   Ú	curveNamer–   r�   Úcombinedr˜   s   &&                 r2   Ú_fromString_PRIVATE_BLOBÚKey._fromString_PRIVATE_BLOB$  sd  € ô\ Ÿš TÓ*‰ˆà�jÔ Ü%+§\¢\°$¸Ó%:Ñ"ˆA�!˜˜dØ×)Ñ)¨A°aÀÐ)ÓBÐBØ˜
Ô"Ü"(§,¢,¨t°QÓ"7ÑˆA�!˜Ø×)Ñ)¨A°aÀÐ)ÓBÐBØœÔ#Ü Õ(ˆEÜ!'§¢¨d°AÓ!6ÑˆI˜$ØœJ u§z¡z×'8Ñ'8¸Ó'AÕBÔBÝ!ã!*ªGð5óð ô "(§¢¨dÓ!3ÑˆLØ×*Ñ*Ø¸Lð +ó ð ð ˜Ô&ô !'§¢¨T°1Ó 5ÑˆAˆx˜Ø˜•ˆAØ×-Ñ-¨a°1Ð-Ó5Ð5äÐ 3°G°9Ð=Ó>Ð>r1   c                óÆ   € VP                  R4      '       d   V ! \        V\        4       4      4      # \        VP	                  4       ^,          4      pV P                  V4      # )aL  
Return a public key object corresponding to this OpenSSH public key
string.  The format of an OpenSSH public key string is::
    <key type> <base64-encoded public key blob>

@type data: L{bytes}
@param data: The key data.

@return: A new key.
@rtype: L{twisted.conch.ssh.keys.Key}
@raises BadKeyError: if the blob type is unknown.
s
   ecdsa-sha2)r†   r   r   r   ÚsplitrŽ   )rY   rg   r‡   s   && r2   Ú_fromString_PUBLIC_OPENSSHÚKey._fromString_PUBLIC_OPENSSHo  sN   € ð  �?‰?˜=×)Ò)ÙÔ*¨4´Ó1BÓCÓDÐDÜ˜4Ÿ:™:›<¨�?Ó+ˆØ×#Ñ# DÓ)Ð)r1   c           	     ó¸  € VP                  4       P                  4       p\        RP                  V^R 4      4      pVP	                  R4      '       g   \        R4      hV\        R4      R p\        P                  ! V^4      w  rVrx\        P                  ! RVR,          4      ^ ,          p	V	^8w  d   \        R4      h\        P                  ! VR,          ^4      w  r«p
VR	8w  Eda   V'       g   \        R
4      hVR9   d/   \        P                  p^p\        VR,          4      ^,          pTpM\        RV: 24      hVR8X  da   \        P                  ! V4      w  pp\        P                  ! RVR,          4      ^ ,          p\        P                   ! VVWï,           VRR7      pM\        RV: 24      h\        V4      V,          ^ 8w  d   \        R4      h\#        V! VRV 4      \$        P&                  ! VWîV,            4      \)        4       R7      P+                  4       pVP-                  V4      VP/                  4       ,           pMVR	8w  d   \        RV: R24      hTp\        P                  ! RVR,          4      ^ ,          p\        P                  ! RVR,          4      ^ ,          pVV8w  d   \        RVV3,          4      hV P1                  VR,          4      # )a‚  
Return a private key object corresponding to this OpenSSH private key
string, in the "openssh-key-v1" format introduced in OpenSSH 6.5.

The format of an openssh-key-v1 private key string is::
    -----BEGIN OPENSSH PRIVATE KEY-----
    <base64-encoded SSH protocol string>
    -----END OPENSSH PRIVATE KEY-----

The SSH protocol string is as described in
U{PROTOCOL.key<https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL.key>}.

@type data: L{bytes}
@param data: The key data.

@type passphrase: L{bytes} or L{None}
@param passphrase: The passphrase the key is encrypted with, or L{None}
if it is not encrypted.

@return: A new key.
@rtype: L{twisted.conch.ssh.keys.Key}
@raises BadKeyError: if
    * a passphrase is provided for an unencrypted key
    * the SSH protocol encoding is incorrect
@raises EncryptedKeyError: if
    * a passphrase is not provided for an encrypted key
r1   ó   openssh-key-v1 z"unknown OpenSSH private key formatNú!L:Né   NzDonly OpenSSH private key files containing a single key are supportedºr©   NNó   noneú0Passphrase must be provided for an encrypted key:é   é   Nzunknown encryption type ó   bcryptT)Úignore_few_roundszunknown KDF type zbad padding©Úbackendzprivate key specifies KDF z but no cipher:r©   é   Nz#check values do not match: %d != %d:r³   NNéÿÿÿÿ)s
   aes128-ctrs
   aes192-ctró
   aes256-ctr)ÚstripÚ
splitlinesr   Újoinr†   r(   Úlenr   rz   ÚstructÚunpackr7   r   ÚAESÚintÚbcryptÚkdfr   r   ÚCTRr   Ú	decryptorÚupdateÚfinalizer    )rY   rg   rP   ÚlinesÚkeyListÚcipherr¿   Ú
kdfOptionsr‰   r‹   Ú_ÚencPrivKeyListÚalgorithmClassÚ	blockSizeÚkeySizeÚivSizeÚsaltÚroundsÚdecKeyrÁ   ÚprivKeyListÚcheck1Úcheck2s   &&&                    r2   Ú_fromPrivateOpenSSH_v1ÚKey._fromPrivateOpenSSH_v1„  s�  € ð: —
‘
“×'Ñ'Ó)ˆÜ˜cŸh™h u¨Q¨r {Ó3Ó4ˆØ×!Ñ!Ð"5×6Ò6ÜÐBÓCÐCØœ#Ð1Ó2Ð4Ð5ˆÜ(.¯ª°W¸aÓ(@Ñ%ˆ�ZÜ�MŠM˜$  R¥Ó)¨!Õ,ˆØ�Œ6Üð-óð ô
  &Ÿ|š|¨D°­H°aÓ8Ñˆ˜1Ø�WÕßÜ'ØIóð ð ÐFÔFÜ!+§¡�Ø�	Ü˜f S�kÓ*¨aÕ/�Ø"‘ä!Ð$<¸V¹JÐ"GÓHÐHØ�iÔÜ#Ÿ\š\¨*Ó5‘
��dÜŸš t¨T°"­XÓ6°qÕ9�ÜŸšØØØÕ$Øà&*ô‘ô "Ð$5°c±WÐ"=Ó>Ð>Ü�NÓ# iÕ/°AÔ5Ü! -Ó0Ð0ÜÙ˜v h wÐ/Ó0Ü—	’	˜& °VÕ+;Ð<Ó=Ü'Ó)ô÷ ‰i‹kð	 ð
 $×*Ñ*¨>Ó:¸Y×=OÑ=OÓ=QÕQ‰Kà�gŒ~Ý!ÛGJÐLóð ð )ˆKÜ—’˜t [°¥_Ó5°aÕ8ˆÜ—’˜t [°Õ%5Ó6°qÕ9ˆØ�VÔÜÐCÀvÈvÐFVÕVÓWÐWØ×+Ñ+¨K¸­OÓ<Ð<r1   c                ó,  € VP                  4       P                  4       pV^ ,          ^R pV'       g   RpVR9   d    \        W\        4       4      pT ! T4      # \        RV 24      h  \         d    \        R4      h\         d    \        R4      hi ; i)añ  
Return a private key object corresponding to this OpenSSH private key
string, in the old PEM-based format.

The format of a PEM-based OpenSSH private key string is::
    -----BEGIN <key type> PRIVATE KEY-----
    [Proc-Type: 4,ENCRYPTED
    DEK-Info: DES-EDE3-CBC,<initialization value>]
    <base64-encoded ASN.1 structure>
    ------END <key type> PRIVATE KEY------

The ASN.1 structure of a RSA key is::
    (0, n, e, d, p, q)

The ASN.1 structure of a DSA key is::
    (0, p, q, g, y, x)

The ASN.1 structure of a ECDSA key is::
    (ECParameters, OID, NULL)

@type data: L{bytes}
@param data: The key data.

@type passphrase: L{bytes} or L{None}
@param passphrase: The passphrase the key is encrypted with, or L{None}
if it is not encrypted.

@return: A new key.
@rtype: L{twisted.conch.ssh.keys.Key}
@raises BadKeyError: if
    * a passphrase is provided for an unencrypted key
    * the ASN.1 encoding is incorrect
@raises EncryptedKeyError: if
    * a passphrase is not provided for an encrypted key
Nr¬   z&Failed to decode key (Bad Passphrase?)úunknown key type éïÿÿÿ)s   ECs   RSAs   DSA)r¶   r·   r   r   Ú	TypeErrorr7   Ú
ValueErrorr(   )rY   rg   rP   rÄ   ÚkindÚkeys   &&&   r2   Ú_fromPrivateOpenSSH_PEMÚKey._fromPrivateOpenSSH_PEMÝ  s¨   € ðJ —
‘
“×'Ñ'Ó)ˆØ�Q�x˜˜3Ðˆ÷ ØˆJØÐ*Ô*ðLÜ*¨4¼_Ó=NÓO�ñ �s“8ˆOäÐ 1°$°Ð8Ó9Ð9øô ô Ü'ØFóð ô ô LÜ!Ð"JÓKÐKðLús   ½A' Á'BÂBc                ó    € VP                  4       P                  4       ^ ,          ^R R8X  d   V P                  W4      # V P                  W4      # )ax  
Return a private key object corresponding to this OpenSSH private key
string.  If the key is encrypted, passphrase MUST be provided.
Providing a passphrase for an unencrypted key is an error.

@type data: L{bytes}
@param data: The key data.

@type passphrase: L{bytes} or L{None}
@param passphrase: The passphrase the key is encrypted with, or L{None}
if it is not encrypted.

@return: A new key.
@rtype: L{twisted.conch.ssh.keys.Key}
@raises BadKeyError: if
    * a passphrase is provided for an unencrypted key
    * the encoding is incorrect
@raises EncryptedKeyError: if
    * a passphrase is not provided for an encrypted key
s   OPENSSHrØ   )r¶   r·   rÔ   rÝ   )rY   rg   rP   s   &&&r2   Ú_fromString_PRIVATE_OPENSSHÚKey._fromString_PRIVATE_OPENSSH  sK   € ð, �:‰:‹<×"Ñ"Ó$ QÕ'¨¨3Ð/°:Ô=à×-Ñ-¨dÓ?Ð?ð ×.Ñ.¨tÓ@Ð@r1   c                ó2  € \         P                  ! \        V^R 4      4      pV^ ,          R8X  g   Q h/ pV^,          R,           F8  w  rA\        P                  ! \        P
                  ! V4      4      ^ ,          W4&   K:  	  V^,          ^ ,          R8X  d2   V P                  VR,          VR,          VR,          VR,          R7      # V^,          ^ ,          R	8X  d"   V P                  VR
,          VR,          R7      # \        RV^,          ^ ,           24      h)aÂ  
Return a public key corresponding to this LSH public key string.
The LSH public key string format is::
    <s-expression: ('public-key', (<key type>, (<name, <value>)+))>

The names for a RSA (key type 'rsa-pkcs1-sha1') key are: n, e.
The names for a DSA (key type 'dsa') key are: y, g, p, q.

@type data: L{bytes}
@param data: The key data.

@return: A new key.
@rtype: L{twisted.conch.ssh.keys.Key}
@raises BadKeyError: if the key type is unknown
ó
   public-keyºé   NNó   dsaó   yó   gó   pó   q)rr   rp   rn   ro   ó   rsa-pkcs1-sha1ó   nó   e)r‹   rŠ   úunknown lsh key type r´   )	r   Úparser   r   r{   ÚNSrš   r™   r(   ©rY   rg   ÚsexpÚkdrœ   s   &&   r2   Ú_fromString_PUBLIC_LSHÚKey._fromString_PUBLIC_LSH3  sô   € ô" �{Š{œ; t¨A¨b zÓ2Ó3ˆØ�A�w˜-Ô'Ð'Ð'ØˆØ˜q�' "Ÿ+˜+‰JˆDÜ—|’|¤F§I¢I¨d£OÓ4°QÕ7ˆB‹Hñ &à��7�1�:˜ÔØ×)Ñ)Ø�T•(˜b �h¨"¨T­(°b¸µhð *ó ð ð �!�W�Q�ZÐ,Ô,Ø×)Ñ)¨B¨t­H¸¸4½Ð)ÓAÐAäÐ 5°d¸1µg¸aµj°\ÐBÓCÐCr1   c                ó6  € \         P                  ! V4      pV^ ,          R8X  g   Q h/ pV^,          R,           F8  w  rA\        P                  ! \        P                  ! V4      4      ^ ,          W4&   K:  	  V^,          ^ ,          R8X  dZ   \        V4      ^8X  g   Q \        V4      4       hV P                  VR,          VR,          VR,          VR,          VR,          R	7      # V^,          ^ ,          R
8X  dˆ   \        V4      ^8X  g   Q \        V4      4       hVR,          VR,          8”  d   VR,          VR,          uVR&   VR&   V P                  VR,          VR,          VR,          VR,          VR,          R7      # \        RV^,          ^ ,           24      h)aÓ  
Return a private key corresponding to this LSH private key string.
The LSH private key string format is::
    <s-expression: ('private-key', (<key type>, (<name>, <value>)+))>

The names for a RSA (key type 'rsa-pkcs1-sha1') key are: n, e, d, p, q.
The names for a DSA (key type 'dsa') key are: y, g, p, q, x.

@type data: L{bytes}
@param data: The key data.

@return: A new key.
@rtype: L{twisted.conch.ssh.keys.Key}
@raises BadKeyError: if the key type is unknown
ó   private-keyrä   ræ   rç   rè   ré   rê   ó   xr“   ó	   rsa-pkcs1rì   rí   ó   dr‘   rî   )	r   rï   r   r{   rð   r¹   rš   r™   r(   rñ   s   &&   r2   Ú_fromString_PRIVATE_LSHÚKey._fromString_PRIVATE_LSHS  sg  € ô" �{Š{˜4Ó ˆØ�A�w˜.Ô(Ð(Ð(ØˆØ˜q�' "Ÿ+˜+‰JˆDÜ—|’|¤F§I¢I¨d£OÓ4°QÕ7ˆB‹Hñ &à��7�1�:˜ÔÜ�r“7˜a”<Ð(¤ R£Ó(�<Ø×)Ñ)Ø�T•(˜b �h¨"¨T­(°b¸µhÀ"ÀTÅ(ð *ó ð ð �!�W�Q�Z˜<Ô'Ü�r“7˜a”<Ð(¤ R£Ó(�<Ø�$�x˜"˜T�(Ô"Ø%'¨¥X¨r°$­xÐ"��4‘˜"˜T™(Ø×)Ñ)Ø�T•(˜b �h¨"¨T­(°b¸µhÀ"ÀTÅ(ð *ó ð ô
 Ð 5°d¸1µg¸aµj°\ÐBÓCÐCr1   c           	     óÊ  € \         P                  ! V4      w  r!VR8X  d�   \         P                  ! V4      w  r1\         P                  ! V4      w  rA\         P                  ! V4      w  rQ\         P                  ! V4      w  ra\         P                  ! V4      w  rqV P                  WeW4VR7      # VR8X  d¥   \         P                  ! V4      w  r�\         P                  ! V4      w  r‘\         P                  ! V4      w  r¡\         P                  ! V4      w  r±\         P                  ! V4      w  r1\         P                  ! V4      w  rAV P	                  W¨W“WKR7      # \        RV 24      h)a'  
Return a private key object corresponsing to the Secure Shell Key
Agent v3 format.

The SSH Key Agent v3 format for a RSA key is::
    string 'ssh-rsa'
    integer e
    integer d
    integer n
    integer u
    integer p
    integer q

The SSH Key Agent v3 format for a DSA key is::
    string 'ssh-dss'
    integer p
    integer q
    integer g
    integer y
    integer x

@type data: L{bytes}
@param data: The key data.

@return: A new key.
@rtype: L{twisted.conch.ssh.keys.Key}
@raises BadKeyError: if the key type (the first string) is unknown
rl   r“   rk   )r‹   rŠ   r’   rn   ro   r�   r×   )r   rz   r{   rš   r™   r(   )rY   rg   rˆ   rn   ro   rp   rr   r”   rŠ   r’   r‹   r�   s   &&          r2   Ú_fromString_AGENTV3ÚKey._fromString_AGENTV3y  s  € ô< Ÿš TÓ*‰ˆØ�jÔ Ü—l’l 4Ó(‰GˆAÜ—l’l 4Ó(‰GˆAÜ—l’l 4Ó(‰GˆAÜ—l’l 4Ó(‰GˆAÜ—l’l 4Ó(‰GˆAØ×)Ñ)¨A°aÀÐ)ÓBÐBØ˜
Ô"Ü—l’l 4Ó(‰GˆAÜ—l’l 4Ó(‰GˆAÜ—l’l 4Ó(‰GˆAÜ—l’l 4Ó(‰GˆAÜ—l’l 4Ó(‰GˆAÜ—l’l 4Ó(‰GˆAØ×)Ñ)¨A°aÀÐ)ÓGÐGäÐ 1°'°Ð;Ó<Ð<r1   c                óT  € VP                  R4      '       g   VP                  R4      '       d   R# VP                  R4      '       g   VP                  R4      '       d   \        R4      hVP                  R4      '       g   VP                  R4      '       d   R# VP                  R	4      '       d   R
# VP                  R4      '       d   R# VP                  R4      '       d   R# VP                  R4      '       g]   VP                  R4      '       gF   VP                  R4      '       g/   VP                  R4      '       g   VP                  R4      '       dQ   \        P                  ! V4      w  r#^ pV'       d$   V^,          p\        P                  ! V4      w  r#K+  V^8”  d   R# R# R# )zz
Guess the type of key in data.  The types map to _fromString_*
methods.

@type data: L{bytes}
@param data: The key data.
s   ssh-ó   ecdsa-sha2-Úpublic_opensshs   sk-ecdsa-sha2-nistp256-cert-v01s   sk-ssh-ed25519-cert-v01z(certificate based keys are not supporteds   sk-ecdsa-sha2-nistp256s   sk-ssh-ed25519s
   -----BEGINÚprivate_opensshó   {Ú
public_lshó   (Úprivate_lshs      ssh-s
      ecdsa-s      ssh-ed25519s&      "sk-ecdsa-sha2-nistp256@openssh.coms      sk-ssh-ed25519@openssh.comÚagentv3r‡   N)r†   r(   r   rz   r{   )rY   rg   Úignoredr‰   Úcounts   &&   r2   rb   ÚKey._guessStringTypeª  sO  € ð �?‰?˜7×#Ò# t§¡°~×'FÒ'FÙ#ð �?‰?Ð=×>Ò>À$Ç/Á/Ø&÷C
ò C
ô ÐHÓIÐIà�?‰?Ð4×5Ò5¸¿¹Ø÷:
ò :
ñ $à�?‰?˜=×)Ò)Ù$à�?‰?˜4× Ò Ùà�?‰?˜4× Ò Ù ð �O‰OÐ3×4Ò4Ø�‰Ð8×9Ò9Ø�‰Ð=×>Ò>Ø�‰ÐQ×RÒRØ�‰ÐL×MÒMä"ŸLšL¨Ó.‰MˆGØˆEßØ˜•
�Ü &§¢¨TÓ 2‘�™Ø�qŒyÙ áñ Nr1   c                ó`  € \         P                  ! W!R7      pVf   VP                  \        4       4      pMr\         P                  ! VVV\         P
                  ! W44      \         P                  ! W54      \         P                  ! WE4      VR7      p	V	P                  \        4       4      pV ! V4      # )aL  
Build a key from RSA numerical components.

@type n: L{int}
@param n: The 'n' RSA variable.

@type e: L{int}
@param e: The 'e' RSA variable.

@type d: L{int} or L{None}
@param d: The 'd' RSA variable (optional for a public key).

@type p: L{int} or L{None}
@param p: The 'p' RSA variable (optional for a public key).

@type q: L{int} or L{None}
@param q: The 'q' RSA variable (optional for a public key).

@type u: L{int} or L{None}
@param u: The 'u' RSA variable. Ignored, as its value is determined by
p and q.

@rtype: L{Key}
@return: An RSA key constructed from the values as given.
)rŠ   r‹   )rn   ro   r’   Údmp1Údmq1ÚiqmpÚpublic_numbers)	r   r|   r}   r   ÚRSAPrivateNumbersÚrsa_crt_dmp1Úrsa_crt_dmq1Úrsa_crt_iqmpÚprivate_key)
rY   r‹   rŠ   r’   rn   ro   r�   ÚpublicNumbersrŒ   ÚprivateNumberss
   &&&&&&&   r2   r™   ÚKey._fromRSAComponentsß  s‘   € ô6 ×,Ò,¨qÔ6ˆØŠ9à%×0Ñ0´Ó1BÓC‰Iä ×2Ò2ØØØÜ×%Ò% aÓ+Ü×%Ò% aÓ+Ü×%Ò% aÓ+Ø,ôˆNð '×2Ñ2´?Ó3DÓEˆIá�9‹~Ðr1   c           	     ó
  € \         P                  ! V\         P                  ! W#VR7      R7      pVf   VP                  \	        4       4      pM0\         P
                  ! WVR7      pVP                  \	        4       4      pV ! V4      # )a�  
Build a key from DSA numerical components.

@type y: L{int}
@param y: The 'y' DSA variable.

@type p: L{int}
@param p: The 'p' DSA variable.

@type q: L{int}
@param q: The 'q' DSA variable.

@type g: L{int}
@param g: The 'g' DSA variable.

@type x: L{int} or L{None}
@param x: The 'x' DSA variable (optional for a public key)

@rtype: L{Key}
@return: A DSA key constructed from the values as given.
rm   rq   )r”   r  )r   r~   r   r}   r   ÚDSAPrivateNumbersr  )	rY   rr   rn   ro   rp   r”   r  rŒ   r  s	   &&&&&&   r2   rš   ÚKey._fromDSAComponents  sm   € ô. ×,Ò,Ø¤3×#:Ò#:¸QÀqÔ#Iô
ˆð Š9à%×0Ñ0´Ó1BÓC‰Iä ×2Ò2°QÔUˆNØ&×2Ñ2´?Ó3DÓEˆIá�9‹~Ðr1   c                óô   € \         P                  ! W\        V,          R7      pVf   VP                  \	        4       4      pM0\         P
                  ! WER7      pVP                  \	        4       4      pV ! V4      # )a[  
Build a key from EC components.

@param x: The affine x component of the public point used for verifying.
@type x: L{int}

@param y: The affine y component of the public point used for verifying.
@type y: L{int}

@param curve: NIST name of elliptic curve.
@type curve: L{bytes}

@param privateValue: The private value.
@type privateValue: L{int}
)r”   rr   rv   )Úprivate_valuer  )r   ÚEllipticCurvePublicNumbersr€   r}   r   ÚEllipticCurvePrivateNumbersr  )rY   r”   rr   rv   r–   r  rŒ   r  s   &&&&&   r2   Ú_fromECComponentsÚKey._fromECComponents/  sk   € ô$ ×5Ò5ØœK¨Õ.ô
ˆð Òà%×0Ñ0´Ó1BÓC‰Iä×;Ò;Ø*ôˆNð '×2Ñ2´?Ó3DÓEˆIá�9‹~Ðr1   c                óÈ   € Vf-   \         P                  P                  \        V,          V4      pM+\         P                  ! V\        V,          \        4       4      pV ! V4      # )a  
Build a key from an EC encoded point.

@param encodedPoint: The public point encoded as in SEC 1 v2.0
section 2.3.3.
@type encodedPoint: L{bytes}

@param curve: NIST name of elliptic curve.
@type curve: L{bytes}

@param privateValue: The private value.
@type privateValue: L{int}
)r   r�   r‚   r€   Úderive_private_keyr   )rY   ru   rv   r–   rŒ   s   &&&& r2   rƒ   ÚKey._fromECEncodedPointO  sW   € ð  Òä×1Ñ1×DÑDÜ˜EÕ" Ló‰Iô ×-Ò-Øœk¨%Õ0´/Ó2CóˆIñ �9‹~Ðr1   c                ó¦   € \         e	   \        f   \        R4      hVf   \         P                  V4      pM\        P	                  V4      pV ! V4      # )zäBuild a key from Ed25519 components.

@param a: The Ed25519 public key, as defined in RFC 8032 section
    5.1.5.
@type a: L{bytes}

@param k: The Ed25519 private key, as defined in RFC 8032 section
    5.1.5.
@type k: L{bytes}
z)Ed25519 keys not supported on this system)ÚEd25519PublicKeyÚEd25519PrivateKeyr(   Úfrom_public_bytesÚfrom_private_bytes)rY   r�   r˜   rŒ   s   &&& r2   r…   ÚKey._fromEd25519Componentsk  sK   € ô Ò#Ô'8Ò'@ÜÐIÓJÐJàŠ9Ü(×:Ñ:¸1Ó=‰Iä)×<Ñ<¸QÓ?ˆIá�9‹~Ðr1   c                ó    € Wn         RV n        R# )z¼
Initialize with a private or public
C{cryptography.hazmat.primitives.asymmetric} key.

@param keyObject: Low level key.
@type keyObject: C{cryptography.hazmat.primitives.asymmetric} key.
FN©Ú
_keyObjectr„   )ÚselfrŒ   s   &&r2   Ú__init__ÚKey.__init__‚  s   € ð $ŒØˆŽr1   c               ó    € V ^8„  d   QhRRRR/# )é   ÚotherÚobjectÚreturnÚboolr)   )Úformats   "r2   Ú__annotate__ÚKey.__annotate__�  s   € ÷ "ñ "˜Fð " tñ "r1   c                óÎ   € \        V\        4      '       dK   V P                  4       VP                  4       8H  ;'       d"    V P                  4       VP                  4       8H  # \        # )z>
Return True if other represents an object with the same key.
)rJ   rS   r[   rg   ÚNotImplemented)r.  r3  s   &&r2   Ú__eq__Ú
Key.__eq__�  sG   € ô �eœS×!Ò!Ø—9‘9“; %§*¡*£,Ñ.×NÐN°4·9±9³;À%Ç*Á*Ã,Ñ3NÐNä!Ð!r1   c               ó   € V ^8„  d   QhRR/# )r2  r5  rK   r)   )r7  s   "r2   r8  r9  –  s   € ÷ *$ñ *$˜#ñ *$r1   c                ó:  € V P                  4       R8X  d¡   V P                  4       pVR,          P                  R4      pV P                  4       '       d   RVRR  R2pM	RVRR  R2p\	        VP                  4       4       F)  w  rEVR8X  d   VRV 2,          pK  VR	V R
V 2,          pK+  	  VR,           # R\        V P                  4       4      : RV P                  4       ;'       d    R;'       g    R: RV P                  4       : R2.p\	        V P                  4       P                  4       4       FÁ  w  rEVP                  RV R24       V P                  4       R8X  d   TM\        P                  ! V4      R,          pV'       g   KX  VR,          pVR,          pRp	\        V4       F  p
V	\        V
4      R R2,           p	K  	  \        V4      ^8  d   V	RR p	VP                  RV	,           4       Ku  	  VR,          R,           VR&   R	P                  V4      # )z0
Return a pretty representation of this object.
ÚECrv   r`   z<Elliptic Curve Public Key (Nz bits)z<Elliptic Curve Private Key (z	
curve:
	Ú
z:
	z>
Ú<Ú z
Public KeyzPrivate Keyz (zattr Ú:ÚEd25519rª   :Né   N:rF  NNÚ Ú02xÚ	Ú>éýÿÿÿr´   )r[   rg   ÚdecodeÚisPublicÚsortedÚitemsr    ÚsizeÚappendr   ÚMPr   Úordr¹   r¸   )r.  rg   rœ   Úoutr˜   ÚvrÄ   ÚbyÚmÚorF   s   &          r2   Ú__repr__ÚKey.__repr__–  sÜ  € ð �9‰9‹;˜$ÔØ—9‘9“;ˆDØ˜•=×'Ñ'¨Ó0ˆDà�}‰}�ŠØ4°T¸"¸#°Y°K¸vÐF‘à5°d¸2¸3°i°[ÀÐG�ä˜tŸz™z›|Ö,‘�Ø˜”<Ø˜\¨$¨Ð0Õ0’Cà˜R ˜s %¨ sÐ+Õ+’Cñ	 -ð ˜•;Ðð ô( ! §¡£Ö-Ø—M‘M“O×4Ð4¨×EÐE¸ÒEØ—I‘I–Kð	ðˆEô ˜tŸy™y›{×0Ñ0Ó2Ö3‘�Ø—‘˜u Q C q˜\Ô*ØŸ)™)›+¨Ô2‘Q¼¿	º	À!»ÀRÕ8H�ß‘bØ˜3��AØ˜C��BØ�AÜ& qž\˜Ø¤3 q£6¨# ,¨aÐ 0Õ0šñ *ä˜1“v ”{Ø˜c˜r˜F˜Ø—L‘L ¨¥Ö*ñ 4ð ˜b�	 C�ˆE�"‰IØ—9‘9˜UÓ#Ð#r1   c                ó¦   € \        V P                  \        P                  \        P
                  \        P                  \        P                  34      # )zT
Check if this instance is a public key.

@return: C{True} if this is a public key.
)
rJ   r-  r   ÚRSAPublicKeyr   ÚDSAPublicKeyr   r�   r   r&  ©r.  s   &r2   rM  ÚKey.isPublicÂ  sA   € ô Ø�O‰Oä× Ñ Ü× Ñ Ü×)Ñ)Ü×(Ñ(ð	ó
ð 	
r1   c                óx   € V P                  4       '       d   V # \        V P                  P                  4       4      # )z´
Returns a version of this key containing only the public key data.
If this is a public key, this may or may not be the same object
as self.

@rtype: L{Key}
@return: A public key.
)rM  rS   r-  r}   r^  s   &r2   ÚpublicÚ
Key.publicÒ  s,   € ð �=‰=�?Š?ØˆKä�t—‘×1Ñ1Ó3Ó4Ð4r1   c           
     óÂ  € V\         P                  J d:   \        \        \	        V P                  4       4      P                  4       4      4      # V\         P                  J dm   \        RP                  \        \        V P                  4       4      P                  4       4       Uu. uF  p\        P                  ! V4      NK  	  up4      4      # \        RV 24      hu upi )a¯  
The fingerprint of a public key consists of the output of the
message-digest algorithm in the specified format.
Supported formats include L{FingerprintFormats.MD5_HEX} and
L{FingerprintFormats.SHA256_BASE64}

The input to the algorithm is the public key data as specified by [RFC4253].

The output of sha256[RFC4634] algorithm is presented to the
user in the form of base64 encoded sha256 hashes.
Example: C{US5jTUa0kgX5ZxdqaGF0yGRu8EgKXHNmoT8jHKo1StM=}

The output of the MD5[RFC1321](default) algorithm is presented to the user as
a sequence of 16 octets printed as hexadecimal with lowercase letters
and separated by colons.
Example: C{c1:b1:30:29:d7:b8:de:6c:97:77:10:d7:46:41:63:87}

@param format: Format for fingerprint generation. Consists
    hash function and representation format.
    Default is L{FingerprintFormats.MD5_HEX}

@since: 8.2

@return: the user presentation of this L{Key}'s fingerprint, as a
string.

@rtype: L{str}
ó   :z Unsupported fingerprint format: )r;   r=   r    r   r   r‡   Údigestr<   r¸   r   r   ÚbinasciiÚhexlifyr9   )r.  r7  r”   s   && r2   ÚfingerprintÚKey.fingerprintà  s²   € ð: Ô'×5Ñ5Ó5Ü¤	¬&°·±³Ó*=×*DÑ*DÓ*FÓ GÓHÐHØÔ)×1Ñ1Ó1ÜØ—	‘	Ü2;¼CÀÇ	Á	ÃÓ<L×<SÑ<SÓ<UÔ2VÓWÑ2V¨Q”X×%Ò% aÖ(Ñ2VÑWóóð ô 'Ð)IÈ&ÈÐ'RÓSÐSùò	 Xs   Â$Cc               ó   € V ^8„  d   QhRR/# )r2  r5  z&Literal['RSA', 'DSA', 'EC', 'Ed25519']r)   )r7  s   "r2   r8  r9    s   € ÷ Oñ OÐ<ñ Or1   c                ó  € \        V P                  \        P                  \        P                  34      '       d   R# \        V P                  \
        P                  \
        P                  34      '       d   R# \        V P                  \        P                  \        P                  34      '       d   R# \        V P                  \        P                  \        P                  34      '       d   R# \        RV P                  : 24      h)z«
Return the type of the object we wrap.  Currently this can only be
'RSA', 'DSA', 'EC', or 'Ed25519'.

@rtype: L{str}
@raises RuntimeError: If the object type is unknown.
ÚRSAÚDSAr@  rE  zunknown type of object: )rJ   r-  r   r\  ÚRSAPrivateKeyr   r]  ÚDSAPrivateKeyr   r�   ÚEllipticCurvePrivateKeyr   r&  r'  ÚRuntimeErrorr^  s   &r2   r[   ÚKey.type  s¾   € ô �d—o‘o¬×(8Ñ(8¼#×:KÑ:KÐ'L×MÒMÙÜ˜Ÿ™¬#×*:Ñ*:¼C×<MÑ<MÐ)N×OÒOÙÜØ�O‰Oœb×7Ñ7¼×9SÑ9SÐT÷
ò 
ñ ÜØ�O‰Oœg×6Ñ6¼×8QÑ8QÐR÷
ò 
ñ äÐ!9¸$¿/¹/Ñ9LÐMÓNÐNr1   c                ó>  € V P                   '       d   V P                  4       R8X  d   R# R# V P                  4       R8X  dB   R\        V P                  P                  P
                  P                  R4      ,          ,           # RRRR	R
R/V P                  4       ,          # )a  
Get the type of the object we wrap as defined in the SSH protocol,
defined in RFC 4253, Section 6.6 and RFC 8332, section 4 (this is a
public key format name, not a public key algorithm name). Currently
this can only be b'ssh-rsa', b'ssh-dss', b'ecdsa-sha2-[identifier]'
or b'ssh-ed25519'.

identifier is the standard NIST curve name

@return: The key type format.
@rtype: L{bytes}
r@  rt   ry   r  r•   rl  rk   rm  rl   rE  rx   )r„   r[   r›   r-  rv   rœ   rN   r^  s   &r2   ÚsshTypeÚKey.sshType  s‰   € ð �8�8ˆ8Ø�y‰y‹{˜dÔ"Ù<ñ
 1à�9‰9‹;˜$Ôà¤¨D¯O©O×,AÑ,A×,FÑ,F×,MÑ,MÈgÓ,VÕ!WÕWðð
 �:Ø�:Ø�~ð
ð �)‰)‹+õ	ð 	r1   c                óV   € V P                  4       R8X  d   . RO# V P                  4       .# )z 
Get the public key signature algorithms supported by this key.

@return: A list of supported public key signature algorithm names.
@rtype: L{list} of L{bytes}
rl  )ó   rsa-sha2-512ó   rsa-sha2-256rk   )r[   rt  r^  s   &r2   ÚsupportedSignatureAlgorithmsÚ Key.supportedSignatureAlgorithms@  s'   € ð �9‰9‹;˜%ÔÚAÐAà—L‘L“NÐ#Ð#r1   c           	     óP  € V P                  4       R8X  dt   WP                  4       8X  d^   V P                  4       pVR8:  d   \        P                  ! 4       # VR8:  d   \        P
                  ! 4       # \        P                  ! 4       # R# V P                  4       R8X  d   \        P                  ! 4       # R\        P                  ! 4       R\        P                  ! 4       R\        P                  ! 4       R	\        P                  ! 4       /P                  V P                  4       V34      # )
z•
Return a hash algorithm for this key type given an SSH signature
algorithm name, or L{None} if no such hash algorithm is defined for
this key type.
r@  é   i€  NrE  )rl  rk   )rl  rx  )rl  rw  )rm  rl   )	r[   rt  rP  r   ÚSHA256ÚSHA384ÚSHA512ÚSHA1Úget)r.  ÚsignatureTyperÌ   s   && r2   Ú_getHashAlgorithmÚKey._getHashAlgorithmL  sÇ   € ð �9‰9‹;˜$Ôà§¡£Ô.ØŸ)™)›+�Ø˜c”>Ü!Ÿ=š=›?Ð*Ø ”^Ü!Ÿ=š=›?Ð*ä!Ÿ=š=›?Ð*áà�9‰9‹;˜)Ô#Ü—=’=“?Ð"ð  ¤§¢£Ø$¤f§m¢m£oØ$¤f§m¢m£oØ¤§¢£ð	
÷
 ‰#ˆt�y‰y‹{˜MÐ*Ó
+ð	,r1   c                óæ   € V P                   f   ^ # V P                  4       R8X  d!   V P                   P                  P                  # V P                  4       R8X  d   R# V P                   P                  # )zV
Return the size of the object we wrap.

@return: The size of the key.
@rtype: L{int}
r@  rE  r|  )r-  r[   rv   Úkey_sizer^  s   &r2   rP  ÚKey.sizei  sV   € ð �?‰?Ò"ÙØ�Y‰Y‹[˜DÔ Ø—?‘?×(Ñ(×1Ñ1Ð1Ø�Y‰Y‹[˜IÔ%ÙØ�‰×'Ñ'Ð'r1   c               ó   € V ^8„  d   QhRR/# )r2  r5  zdict[str, Any]r)   )r7  s   "r2   r8  r9  x  s   € ÷ JJñ JJ�nñ JJr1   c                óÜ	  € \        V P                  \        P                  4      '       d5   V P                  P	                  4       pRVP
                  RVP                  /# \        V P                  \        P                  4      '       d˜   V P                  P                  4       pRVP                  P
                  RVP                  P                  RVP                  RVP                  RVP                  R\        P                  ! VP                  VP                  4      /# \        V P                  \        P                  4      '       dk   V P                  P	                  4       pRVP                  RVP                   P"                  RVP                   P                  RVP                   P                  /# \        V P                  \        P$                  4      '       dŸ   V P                  P                  4       pR	VP&                  RVP                  P                  RVP                  P                   P"                  RVP                  P                   P                  RVP                  P                   P                  /# \        V P                  \(        P*                  4      '       dE   V P                  P	                  4       pR	VP&                  RVP                  R
V P-                  4       /# \        V P                  \(        P.                  4      '       de   V P                  P                  4       pR	VP                  P&                  RVP                  P                  RVP0                  R
V P-                  4       /# \        V P                  \2        P4                  4      '       dO   RV P                  P7                  \8        P:                  P<                  \8        P>                  P<                  4      /# \        V P                  \2        P@                  4      '       d½   RV P                  PC                  4       P7                  \8        P:                  P<                  \8        P>                  P<                  4      RV P                  PE                  \8        P:                  P<                  \8        PF                  P<                  \8        PH                  ! 4       4      /# \K        RV P                   24      h)zG
Return the values of the public key as a dictionary.

@rtype: L{dict}
r‹   rŠ   r’   rn   ro   r�   rr   rp   r”   rv   r–   r�   r˜   zUnexpected key type: )&rJ   r-  r   r\  r  r‹   rŠ   rn  Úprivate_numbersr’   rn   ro   r  r   r]  rr   rs   rp   ro  r”   r   r�   rt  rp  r  r   r&  Úpublic_bytesr   ÚEncodingÚRawÚPublicFormatr'  r}   Úprivate_bytesÚPrivateFormatÚNoEncryptionrq  )r.  Úrsa_pub_numbersÚrsa_priv_numbersÚdsa_pub_numbersÚdsa_priv_numbersÚec_pub_numbersÚec_priv_numberss   &      r2   rg   ÚKey.datax  sÈ  € ô �d—o‘o¤s×'7Ñ'7×8Ò8Ø"Ÿo™o×<Ñ<Ó>ˆOà�_×&Ñ&Ø�_×&Ñ&ðð ô ˜Ÿ™¬×):Ñ):×;Ò;Ø#Ÿ™×>Ñ>Ó@ÐàÐ%×4Ñ4×6Ñ6ØÐ%×4Ñ4×6Ñ6ØÐ%×'Ñ'ØÐ%×'Ñ'ØÐ%×'Ñ'à”S×%Ò%Ð&6×&8Ñ&8Ð:J×:LÑ:LÓMðð ô ˜Ÿ™¬×)9Ñ)9×:Ò:Ø"Ÿo™o×<Ñ<Ó>ˆOà�_×&Ñ&Ø�_×6Ñ6×8Ñ8Ø�_×6Ñ6×8Ñ8Ø�_×6Ñ6×8Ñ8ð	ð ô ˜Ÿ™¬×):Ñ):×;Ò;Ø#Ÿ™×>Ñ>Ó@ÐàÐ%×'Ñ'ØÐ%×4Ñ4×6Ñ6ØÐ%×4Ñ4×FÑF×HÑHØÐ%×4Ñ4×FÑF×HÑHØÐ%×4Ñ4×FÑF×HÑHðð ô ˜Ÿ™¬×)BÑ)B×CÒCØ!Ÿ_™_×;Ñ;Ó=ˆNà�^×%Ñ%Ø�^×%Ñ%Ø˜Ÿ™›ðð ô
 ˜Ÿ™¬×)CÑ)C×DÒDØ"Ÿo™o×=Ñ=Ó?ˆOà�_×3Ñ3×5Ñ5Ø�_×3Ñ3×5Ñ5Ø × =Ñ =Ø˜Ÿ™›ð	ð ô ˜Ÿ™¬×)AÑ)A×BÒBà�T—_‘_×1Ñ1Ü!×*Ñ*×.Ñ.´×0JÑ0J×0NÑ0Nóðð ô
 ˜Ÿ™¬×)BÑ)B×CÒCà�T—_‘_×/Ñ/Ó1×>Ñ>Ü!×*Ñ*×.Ñ.´×0JÑ0J×0NÑ0Nóð �T—_‘_×2Ñ2Ü!×*Ñ*×.Ñ.Ü!×/Ñ/×3Ñ3Ü!×.Ò.Ó0óð		ð 	ô Ð!6°t·±Ð6GÐHÓIÐIr1   c                ó˜  € V P                  4       pV P                  4       pVR8X  d[   \        P                  ! R4      \        P                  ! VR,          4      ,           \        P                  ! VR,          4      ,           # VR8X  dŸ   \        P                  ! R4      \        P                  ! VR,          4      ,           \        P                  ! VR,          4      ,           \        P                  ! VR	,          4      ,           \        P                  ! VR
,          4      ,           # VR8X  dÒ   V P
                  P                  P                  ^,           ^,          p\        P                  ! VR,          4      \        P                  ! VR,          RR 4      ,           \        P                  ! R\        P                  ! VR,          V4      ,           \        P                  ! VR
,          V4      ,           4      ,           # VR8X  d9   \        P                  ! R4      \        P                  ! VR,          4      ,           # \        RV 24      h)aÝ  
Return the public key blob for this key. The blob is the
over-the-wire format for public keys.

SECSH-TRANS RFC 4253 Section 6.6.

RSA keys::
    string 'ssh-rsa'
    integer e
    integer n

DSA keys::
    string 'ssh-dss'
    integer p
    integer q
    integer g
    integer y

EC keys::
    string 'ecdsa-sha2-[identifier]'
    integer x
    integer y

    identifier is the standard NIST curve name

Ed25519 keys::
    string 'ssh-ed25519'
    string a

@rtype: L{bytes}
rl  rk   rŠ   r‹   rm  rl   rn   ro   rp   rr   r@  rv   Nó   r”   rE  rx   r�   úunknown key type: éøÿÿÿ)r[   rg   r   rð   rR  r-  rv   r†  r   r   r(   )r.  r[   rg   Ú
byteLengths   &   r2   r‡   ÚKey.blobÄ  s¥  € ð@ �y‰y‹{ˆØ�y‰y‹{ˆØ�5Œ=Ü—9’9˜ZÓ(¬6¯9ª9°T¸#µYÓ+?Õ?Ä&Ç)Â)ÈDÐQTÍIÓBVÕVÐVØ�UŒ]ä—	’	˜*Ó%Ü—)’)˜D �IÓ&õ'ä—)’)˜D �IÓ&õ'ô —)’)˜D �IÓ&õ'ô —)’)˜D �IÓ&õ	'ðð �TŒ\ØŸ/™/×/Ñ/×8Ñ8¸1Õ<ÀÕBˆJä—	’	˜$˜w�-Ó(Ü—)’)˜D �M¨"¨#Ð.Ó/õ0ä—)’)ØÜ×(Ò(¨¨c­°JÓ?õ@ä×(Ò(¨¨c­°JÓ?õ@óõðð �YÔÜ—9’9˜^Ó,¬v¯yªy¸¸c½Ó/CÕCÐCäÐ 2°4°&Ð9Ó:Ð:r1   c                óš  € V P                  4       pV P                  4       pVR8X  Ed   \        P                  ! VR,          VR,          4      p\        P
                  ! R4      \        P                  ! VR,          4      ,           \        P                  ! VR,          4      ,           \        P                  ! VR,          4      ,           \        P                  ! V4      ,           \        P                  ! VR,          4      ,           \        P                  ! VR,          4      ,           # VR8X  dÁ   \        P
                  ! R	4      \        P                  ! VR,          4      ,           \        P                  ! VR,          4      ,           \        P                  ! VR
,          4      ,           \        P                  ! VR,          4      ,           \        P                  ! VR,          4      ,           # VR8X  dÚ   V P                  P                  4       P                  \        P                  P                  \        P                  P                  4      p\        P
                  ! VR,          4      \        P
                  ! VR,          RR 4      ,           \        P
                  ! V4      ,           \        P                  ! VR,          4      ,           # VR8X  di   \        P
                  ! R4      \        P
                  ! VR,          4      ,           \        P
                  ! VR,          VR,          ,           4      ,           # \        RV 24      h)aI  
Return the private key blob for this key. The blob is the
over-the-wire format for private keys:

Specification in OpenSSH PROTOCOL.agent

RSA keys::

    string 'ssh-rsa'
    integer n
    integer e
    integer d
    integer u
    integer p
    integer q

DSA keys::

    string 'ssh-dss'
    integer p
    integer q
    integer g
    integer y
    integer x

EC keys::

    string 'ecdsa-sha2-[identifier]'
    integer x
    integer y
    integer privateValue

    identifier is the NIST standard curve name.

Ed25519 keys::

    string 'ssh-ed25519'
    string a
    string k || a
rl  rn   ro   rk   r‹   rŠ   r’   rm  rl   rp   rr   r”   r@  rv   Nr–   rE  rx   r�   r˜   r›  rœ  )r[   rg   r   r  r   rð   rR  r-  r}   r‹  r   rŒ  ÚX962rŽ  ÚUncompressedPointr(   )r.  r[   rg   r  ÚencPubs   &    r2   ÚprivateBlobÚKey.privateBlob   sZ  € ðR �y‰y‹{ˆØ�y‰y‹{ˆØ�5�=Ü×#Ò# D¨¥I¨t°C­yÓ9ˆDä—	’	˜*Ó%Ü—)’)˜D �IÓ&õ'ä—)’)˜D �IÓ&õ'ô —)’)˜D �IÓ&õ'ô —)’)˜D“/õ	"ô
 —)’)˜D �IÓ&õ'ô —)’)˜D �IÓ&õ'ðð �UŒ]ä—	’	˜*Ó%Ü—)’)˜D �IÓ&õ'ä—)’)˜D �IÓ&õ'ô —)’)˜D �IÓ&õ'ô —)’)˜D �IÓ&õ	'ô
 —)’)˜D �IÓ&õ'ðð �TŒ\Ø—_‘_×/Ñ/Ó1×>Ñ>Ü×&Ñ&×+Ñ+Ü×*Ñ*×<Ñ<óˆFô
 —	’	˜$˜w�-Ó(Ü—)’)˜D �M¨"¨#Ð.Ó/õ0ä—)’)˜FÓ#õ$ô —)’)˜D Õ0Ó1õ2ðð �YÔä—	’	˜.Ó)Ü—)’)˜D �IÓ&õ'ä—)’)˜D �I¨¨S­	Õ1Ó2õ3ðô Ð 2°4°&Ð9Ó:Ð:r1   ÚextraÚcommentrP   c                óR  € Ve9   \         P                  ! R\        ^R7       V P                  4       '       d   TpMTp\	        V\
        4      '       d   VP                  R4      p\        V4      p\        V RVP                  4        2R4      pVf   \        RV 24      hV! W4VR7      # )aB  
Create a string representation of this key.  If the key is a private
key and you want the representation of its public key, use
C{key.public().toString()}.  type maps to a _toString_* method.

@param type: The type of string to emit.  Currently supported values
    are C{'OPENSSH'}, C{'LSH'}, and C{'AGENTV3'}.
@type type: L{str}

@param extra: Any extra data supported by the selected format which
    is not part of the key itself.  For public OpenSSH keys, this is
    a comment.  For private OpenSSH keys, this is a passphrase to
    encrypt with.  (Deprecated since Twisted 20.3.0; use C{comment}
    or C{passphrase} as appropriate instead.)
@type extra: L{bytes} or L{unicode} or L{None}

@param subtype: A subtype of the requested C{type} to emit.  Only
    supported for private OpenSSH keys, for which the currently
    supported subtypes are C{'PEM'} and C{'v1'}.  If not given, an
    appropriate default is used.
@type subtype: L{str} or L{None}

@param comment: A comment to include with the key.  Only supported
    for OpenSSH keys.

    Present since Twisted 20.3.0.

@type comment: L{bytes} or L{unicode} or L{None}

@param passphrase: A passphrase to encrypt the key with.  Only
    supported for private OpenSSH keys.

    Present since Twisted 20.3.0.

@type passphrase: L{bytes} or L{unicode} or L{None}

@rtype: L{bytes}
Nz„The 'extra' argument to twisted.conch.ssh.keys.Key.toString was deprecated in Twisted 20.3.0; use 'comment' or 'passphrase' instead.)Ú
stacklevelr`   Ú
_toString_r›  )Úsubtyper¦  rP   )ÚwarningsÚwarnÚDeprecationWarningrM  rJ   rK   rN   rQ   rc   rd   r(   )r.  r[   r¥  rª  r¦  rP   rh   s   &&&&&& r2   ÚtoStringÚKey.toStringS  s¡   € ðZ Òä�MŠMðIô #Øõð �}‰}�ŠØ‘à"�
Ü�gœs×#Ò#Ø—n‘n WÓ-ˆGÜ)¨*Ó5ˆ
Ü˜ ¨D¯J©J«L¨>Ð:¸DÓAˆØŠ>ÜÐ 2°4°&Ð9Ó:Ð:Ù˜gÀ:ÔNÐNr1   c                óê  € V P                  4       R8X  ds   V'       g   RpV P                  P                  \        P                  P
                  \        P                  P
                  4      R,           V,           P                  4       # \        V P                  4       4      P                  RR4      pV'       g   RpV P                  4       R,           V,           R,           V,           P                  4       # )zÓ
Return a public OpenSSH key string.

See _fromString_PUBLIC_OPENSSH for the string format.

@type comment: L{bytes} or L{None}
@param comment: A comment to include with the key, or L{None} to
omit the comment.
r@  r1   ó    ó   
)r[   r-  r‹  r   rŒ  ÚOpenSSHrŽ  r¶   r   r‡   Úreplacert  )r.  r¦  Úb64Datas   && r2   Ú_toPublicOpenSSHÚKey._toPublicOpenSSH•  s»   € ð �9‰9‹;˜$ÔßØ�à—‘×,Ñ,Ü!×*Ñ*×2Ñ2´M×4NÑ4N×4VÑ4Vóð õð õ	÷
 ‰e‹gðô ˜dŸi™i›kÓ*×2Ñ2°5¸#Ó>ˆßØˆGØ—‘“ Õ%¨Õ/°$Õ6¸Õ@×GÑGÓIÐIr1   c           	     óÆ  € V'       dw   \         P                  pRpRpVP                  ^,          p^ pTp\        P                  ! V4      p	^dp
\
        P                  ! V	4      \        P                  ! RV
4      ,           pMRpRp^pRp\        P                  ! ^4      pWÌ,           V P                  4       ,           \
        P                  ! T;'       g    R4      ,           p^ p\        V4      V,          '       d&   V^,          pV\        V^ÿ,          34      ,          pK=  V'       d‘   \        P                  ! VX	XX,           ^d4      p\        X! VRV 4      \        P                   ! W÷Wx,            4      \#        4       R7      P%                  4       pVP'                  V4      VP)                  4       ,           pMTpR\
        P                  ! V4      ,           \
        P                  ! V4      ,           \
        P                  ! V4      ,           \        P                  ! R^4      ,           \
        P                  ! V P+                  4       4      ,           \
        P                  ! V4      ,           p\-        V4      P/                  R	R4      pR
.\1        ^ \        V4      ^@4       Uu. uF  pVVV^@,            NK  	  up,           R.,           pR	P3                  V4      R	,           # u upi )a  
Return a private OpenSSH key string, in the "openssh-key-v1" format
introduced in OpenSSH 6.5.

See _fromPrivateOpenSSH_v1 for the string format.

@type passphrase: L{bytes} or L{None}
@param passphrase: The passphrase to encrypt the key with, or L{None}
if it is not encrypted.
rµ   r¯   r¨   r«   r1   Nr±   r§   r²  s#   -----BEGIN OPENSSH PRIVATE KEY-----s!   -----END OPENSSH PRIVATE KEY-----)r   r¼   Ú
block_sizer   ÚsecureRandomr   rð   rº   Úpackr£  r¹   Úbytesr¾   r¿   r   r   rÀ   r   Ú	encryptorrÂ   rÃ   r‡   r   r´  Úranger¸   )r.  r¦  rP   rÆ   Ú
cipherNameÚkdfNamerË   rÌ   rÍ   rÎ   rÏ   rÇ   ÚcheckrÑ   ÚpadByteÚencKeyr½  rÉ   r‡   rµ  ÚirÄ   s   &&&                   r2   Ú_toPrivateOpenSSH_v1ÚKey._toPrivateOpenSSH_v1¯  se  € ÷ ô  —^‘^ˆFØ&ˆJØˆGØ×)Ñ)¨QÕ.ˆIØˆGØˆFÜ×)Ò)¨&Ó1ˆDØˆFÜŸš 4›¬6¯;ª;°t¸VÓ+DÕD‰Jà ˆJØˆGØˆIØˆJÜ×&Ò& qÓ)ˆØ•m d×&6Ñ&6Ó&8Õ8¼6¿9º9ÀWÇ^À^ÐPSÓ;TÕTˆØˆÜ�+Ó ×*Ô*Ø�q�LˆGØœ5 '¨D¥.Ð!2Ó3Õ3ŠKßÜ—Z’Z 
¨D°'¸FÕ2BÀCÓHˆFÜÙ�v˜h˜wÐ'Ó(Ü—	’	˜&¨7Õ+;Ð<Ó=Ü'Ó)ô÷ ‰i‹kð	 ð
 '×-Ñ-¨kÓ:¸Y×=OÑ=OÓ=QÕQ‰Nà(ˆNàÜ�iŠi˜
Ó#õ$ä�iŠi˜Ó õ!ô �iŠi˜
Ó#õ$ô �kŠk˜$ Ó"õ	#ô
 �iŠi˜Ÿ	™	›Ó$õ%ô �iŠi˜Ó'õ(ð 	ô ˜dÓ#×+Ñ+¨E°3Ó7ˆà3Ð4Ü,1°!´S¸³\À2Ô,FÓGÑ,F qˆw�q˜1˜r�6Ó"Ñ,FÑGõHà3Ð4õ5ð 	ð
 �z‰z˜%Ó  5Õ(Ð(ùò Hs   Ê Kc                ór  € V'       g   \         P                  ! 4       pM\         P                  ! V4      pV P                  4       R8w  dN   V P                  P                  \         P                  P                  \         P                  P                  V4      # V P                  4       R8X  g   Q h\        R4      h)zü
Return a private OpenSSH key string, in the old PEM-based format.

See _fromPrivateOpenSSH_PEM for the string format.

@type passphrase: L{bytes} or L{None}
@param passphrase: The passphrase to encrypt the key with, or L{None}
if it is not encrypted.
rE  zBcannot serialize Ed25519 key to OpenSSH PEM format; use v1 instead)r   r‘  ÚBestAvailableEncryptionr[   r-  r�  rŒ  ÚPEMr�  ÚTraditionalOpenSSLrÚ   )r.  rP   r½  s   && r2   Ú_toPrivateOpenSSH_PEMÚKey._toPrivateOpenSSH_PEMí  s‘   € ÷ ä%×2Ò2Ó4‰Iä%×=Ò=¸jÓIˆIØ�9‰9‹;˜)Ô#Ø—?‘?×0Ñ0Ü×&Ñ&×*Ñ*Ü×+Ñ+×>Ñ>Øóð ð —9‘9“; )Ô+Ð+Ð+ÜØWóð r1   c                ó  € V P                  4       '       d   V P                  VR7      # VR8X  g   Vf(   V P                  4       R8X  d   V P                  W#R7      # Ve   VR8X  d   V P	                  VR7      # \        RV 24      h)a
  
Return a public or private OpenSSH string.  See
L{_fromString_PUBLIC_OPENSSH} and L{_fromPrivateOpenSSH_PEM} for the
string formats.

@param subtype: A subtype to emit.  Only supported for private keys,
    for which the currently supported subtypes are C{'PEM'} and C{'v1'}.
    If not given, an appropriate default is used.
@type subtype: L{str} or L{None}

@param comment: Comment for a public key.
@type comment: L{bytes}

@param passphrase: Passphrase for a private key.
@type passphrase: L{bytes}

@rtype: L{bytes}
)r¦  Úv1rE  )r¦  rP   rÉ  rO   zunknown subtype )rM  r¶  r[   rÅ  rË  rÚ   )r.  rª  r¦  rP   s   &&&&r2   Ú_toString_OPENSSHÚKey._toString_OPENSSH	  s‚   € ð& �=‰=�?Š?Ø×(Ñ(°Ð(Ó9Ð9à˜Œ_ ¢°T·Y±Y³[ÀIÔ5MØ×,Ñ,°WÐ,ÓTÐTØŠ_ ¨5Ô 0Ø×-Ñ-¸Ð-ÓDÐDäÐ/°¨yÐ9Ó:Ð:r1   c                óä  € V P                  4       pV P                  4       pV P                  4       '       EdZ   VR8X  df   \        P                  ! RRR\
        P                  ! VR,          4      R,          .R\
        P                  ! VR,          4      R,          ....4      pMÄVR	8X  d°   \        P                  ! RR
R\
        P                  ! VR,          4      R,          .R\
        P                  ! VR,          4      R,          .R\
        P                  ! VR,          4      R,          .R\
        P                  ! VR,          4      R,          ....4      pM\        RV 24      hR\        V4      P                  RR4      ,           R,           # VR8X  Edq   VR,          VR,          re\        P                  ! WV4      p\        P                  ! RRR\
        P                  ! VR,          4      R,          .R\
        P                  ! VR,          4      R,          .R\
        P                  ! VR,          4      R,          .R\
        P                  ! V4      R,          .R\
        P                  ! V4      R,          .R\
        P                  ! VR,          V^,
          ,          4      R,          .R\
        P                  ! VR,          V^,
          ,          4      R,          .R\
        P                  ! V4      R,          ..	..4      # VR	8X  dÔ   \        P                  ! RR
R\
        P                  ! VR,          4      R,          .R\
        P                  ! VR,          4      R,          .R\
        P                  ! VR,          4      R,          .R\
        P                  ! VR,          4      R,          .R\
        P                  ! VR ,          4      R,          ....4      # \        RV R!24      h)"z„
Return a public or private LSH key.  See _fromString_PUBLIC_LSH and
_fromString_PRIVATE_LSH for the key formats.

@rtype: L{bytes}
rl  rã   rë   rì   r‹   rª   rí   rŠ   rm  ræ   ré   rn   rê   ro   rè   rp   rç   rr   r×   r  r²  r1   ó   }r÷   rù   rú   r’   ó   aó   bó   crø   r”   Ú')rg   r[   rM  r   r»  r   rR  r(   r   r´  r   r  )r.  Úkwargsrg   r[   ÚkeyDatarn   ro   r  s   &,      r2   Ú_toString_LSHÚKey._toString_LSH&  s=  € ð �y‰y‹{ˆØ�y‰y‹{ˆØ�=‰=�?‹?Ø�uŒ}ÜŸ*š*ð *à 1Ø!%¤v§y¢y°°cµÓ';¸BÕ'?Ð @Ø!%¤v§y¢y°°cµÓ';¸BÕ'?Ð @ððð	ó‘ð ˜”ÜŸ*š*ð *à &Ø!%¤v§y¢y°°cµÓ';¸BÕ'?Ð @Ø!%¤v§y¢y°°cµÓ';¸BÕ'?Ð @Ø!%¤v§y¢y°°cµÓ';¸BÕ'?Ð @Ø!%¤v§y¢y°°cµÓ';¸BÕ'?Ð @ðð	ðó‘ô "Ð$5°d°VÐ"<Ó=Ð=Øœ+ gÓ.×6Ñ6°u¸cÓBÕBÀTÕIÐIà�u�}Ø˜C•y $ s¥)�1Ü×'Ò'¨Ó-�Ü—z’zð +à ,Ø!%¤v§y¢y°°cµÓ';¸BÕ'?Ð @Ø!%¤v§y¢y°°cµÓ';¸BÕ'?Ð @Ø!%¤v§y¢y°°cµÓ';¸BÕ'?Ð @Ø!%¤v§y¢y°£|°BÕ'7Ð 8Ø!%¤v§y¢y°£|°BÕ'7Ð 8Ø!%¤v§y¢y°°cµ¸aÀ!½eÕ1DÓ'EÀbÕ'IÐ JØ!%¤v§y¢y°°cµ¸aÀ!½eÕ1DÓ'EÀbÕ'IÐ JØ!%¤v§y¢y°£°rÕ':Ð ;ð
ððóð ð$ ˜”Ü—z’zð +à &Ø!%¤v§y¢y°°cµÓ';¸BÕ'?Ð @Ø!%¤v§y¢y°°cµÓ';¸BÕ'?Ð @Ø!%¤v§y¢y°°cµÓ';¸BÕ'?Ð @Ø!%¤v§y¢y°°cµÓ';¸BÕ'?Ð @Ø!%¤v§y¢y°°cµÓ';¸BÕ'?Ð @ðð
ðóð ô  "Ð$5°d°V¸1Ð"=Ó>Ð>r1   c                ó  € V P                  4       pV P                  4       '       gÚ   V P                  4       R8X  d4   VR,          VR,          VR,          VR,          VR,          VR,          3pM?V P                  4       R8X  d+   VR,          VR,          VR	,          VR
,          VR,          3p\        P                  ! V P                  4       4      RP                  \        \        P                  X4      4      ,           # R# )zl
Return a private Secure Shell Agent v3 key.  See
_fromString_AGENTV3 for the key format.

@rtype: L{bytes}
rl  rŠ   r’   r‹   r�   rn   ro   rm  rp   rr   r”   r1   N)	rg   rM  r[   r   rð   rt  r¸   ÚmaprR  )r.  r×  rg   Úvaluess   &,  r2   Ú_toString_AGENTV3ÚKey._toString_AGENTV3x  sÀ   € ð �y‰y‹{ˆØ�}‰}�ŠØ�y‰y‹{˜eÔ#à˜•IØ˜•IØ˜•IØ˜•IØ˜•IØ˜•Ið‘ð —‘“ Ô%Ø˜s�) T¨#¥Y°°Sµ	¸4À½9ÀdÈ3ÅiÐP�Ü—9’9˜TŸ\™\›^Ó,¨s¯x©x¼¼F¿I¹IÀvÓ8NÓ/OÕOÐOñ r1   c               ó$   € V ^8„  d   QhRRRRRR/# )r2  rg   r¼  r‚  zbytes | Noner5  r)   )r7  s   "r2   r8  r9  Ž  s!   € ÷ ?.ñ ?.˜ð ?.¨|ð ?.Àuñ ?.r1   c                óf  € V P                  4       pVf   V P                  4       pV P                  V4      pVf   \        RV: RV R24      hVR8X  dI   V P                  P                  V\        P                  ! 4       V4      p\        P                  ! V4      pEMzVR8X  d\   V P                  P                  W4      p\        V4      w  rx\        P                  ! \        V^4      \        V^4      ,           4      pEMVR8X  dÜ   V P                  P                  V\        P                  ! V4      4      p	\        V	4      w  rx\        V4      p
\        V4      pV
^ ,          pV^€,          '       d
   RV
,           p
V^ ,          pV^€,          '       d
   RV,           p\        P                  ! \        P                  ! V
4      \        P                  ! V4      ,           4      pM6VR8X  d0   \        P                  ! V P                  P                  V4      4      p\        P                  ! V4      X,           # )	a  
Sign some data with this key.

SECSH-TRANS RFC 4253 Section 6.6.

@param data: The data to sign.

@param signatureType: The SSH public key algorithm name to sign this
    data with, or L{None} to use a reasonable default for the key.

@return: A signature for the given data.
zpublic key signature algorithm z is not defined for z keysrl  rm  r@  ó    rE  )r[   rt  rƒ  r4   r-  Úsignr   ÚPKCS1v15r   rð   r"   r   r   ÚECDSA)r.  rg   r‚  rˆ   ÚhashAlgorithmÚsigÚretÚrÚsÚ	signaturerU   ÚsbÚrcompÚscomps   &&&           r2   rã  ÚKey.signŽ  sº  € ð —)‘)“+ˆØÒ ð
 !ŸL™L›NˆMà×.Ñ.¨}Ó=ˆØÒ Ü,Ø1°-Ñ1Bð CØ&˜i uð.óð ð
 �eÔØ—/‘/×&Ñ& t¬W×-=Ò-=Ó-?ÀÓOˆCÜ—)’)˜C“.ŠCà˜ÔØ—/‘/×&Ñ& tÓ;ˆCÜ)¨#Ó.‰FˆQô
 —)’)œL¨¨BÓ/´,¸qÀ"Ó2EÕEÓFŠCà˜Œ_ØŸ™×,Ñ,¨T´2·8²8¸MÓ3JÓKˆIÜ)¨)Ó4‰FˆQä˜a“ˆBÜ˜a“ˆBà�q•EˆEð �t�|Œ|Ø˜r•\�à�q•EˆEà�t�|Œ|Ø˜r•\�ä—)’)œFŸIšI b›M¬F¯IªI°b«MÕ9Ó:‰Cà˜	Ô!Ü—)’)˜DŸO™O×0Ñ0°Ó6Ó7ˆCÜ�yŠy˜Ó'¨#Õ-Ð-r1   c                ój  € \        V4      ^(8X  d   R\        P                  ! V4      rM\        P                  ! V4      w  r1V P	                  V4      pVf   R# V P                  4       pVR8X  di   V P                  pV P                  4       '       g   VP                  4       p\        P                  ! V4      ^ ,          V\        P                  ! 4       V3pEM¹VR8X  d›   \        P                  ! V4      ^ ,          p\        P                  VR,          R4      p	\        P                  VR,          R4      p
\        Wš4      pV P                  pV P                  4       '       g   VP                  4       pWV3pEMVR8X  dº   \        P                  ! V4      ^ ,          p\        P                  ! V^4      w  r¼p\        P                  VR4      p	\        P                  VR4      p
\        Wš4      pV P                  pV P                  4       '       g   VP                  4       pW\        P                  ! V4      3pMXVR	8X  dR   V P                  pV P                  4       '       g   VP                  4       p\        P                  ! V4      ^ ,          V3p XP                   ! X!   R
#   \"         d     R# i ; i)zÛ
Verify a signature using this key.

@type signature: L{bytes}
@param signature: The signature to verify.

@type data: L{bytes}
@param data: The signed data.

@rtype: L{bool}
@return: C{True} if the signature is valid.
rl   Frl  rm  :Né   NÚbig:rñ  NNr@  rE  T)r¹   r   rð   rz   rƒ  r[   r-  rM  r}   r   rä  r½   Ú
from_bytesr#   r   rå  Úverifyr   )r.  rë  rg   r‚  ræ  rˆ   r˜   ÚargsÚconcatenatedSignatureré  rê  ÚrstrÚsstrr‰   s   &&&           r2   rô  Ú
Key.verifyÏ  s  € ô ˆy‹>˜RÔà'1´6·9²9¸YÓ3G™9ä'-§|¢|°IÓ'>Ñ$ˆMà×.Ñ.¨}Ó=ˆØÒ Ùà—)‘)“+ˆØ�eÔØ—‘ˆAØ—=‘=—?’?Ø—L‘L“N�ä—’˜YÓ'¨Õ*ØÜ× Ò Ó"Øð	ŠDð ˜ÔÜ$*§L¢L°Ó$;¸AÕ$>Ð!Ü—‘Ð4°SÕ9¸5ÓAˆAÜ—‘Ð4°SÕ9¸5ÓAˆAÜ,¨QÓ2ˆIØ—‘ˆAØ—=‘=—?’?Ø—L‘L“N�Ø ]Ð3ŠDà˜Œ_Ü$*§L¢L°Ó$;¸AÕ$>Ð!Ü%Ÿ|š|Ð,AÀ1ÓEÑˆD˜Ü—‘˜t UÓ+ˆAÜ—‘˜t UÓ+ˆAÜ,¨QÓ2ˆIà—‘ˆAØ—=‘=—?’?Ø—L‘L“N�à¤R§X¢X¨mÓ%<Ð=‰Dà˜	Ô!Ø—‘ˆAØ—=‘=—?’?Ø—L‘L“N�Ü—L’L Ó+¨AÕ.°Ð5ˆDð	Ø�HŠH�dŠOñ øô  ô 	Úð	ús   ÊJ# Ê#J2Ê1J2r,  )NN)NNNN)N)NNN)2r+   r,   r-   r.   r/   Úclassmethodr]   rW   rŽ   r    r¤   rÔ   rÝ   rà   rô   rû   rþ   rb   r™   rš   r   rƒ   r…   r/  r<  rY  rM  ra  r;   r<   rh  r[   rt  ry  rƒ  rP  rg   r‡   r£  r!   r®  r¶  rÅ  rË  rÏ  rÙ  rÞ  rã  rô  r0   r)   r1   r2   rS   rS   —   s-  † ñð ó>ó ð>ð( ó%,ó ð%,ðN ñD;ó ðD;ðL ñH?ó ðH?ðT ñ*ó ð*ð( ñV=ó ðV=ðp ñ6:ó ð6:ðp ñAó ðAð8 ñDó ðDð> ñ#Dó ð#DðJ ñ.=ó ð.=ð` ñ2ó ð2ðh ó*ó ð*ðX ó ó ð ðD óó ðð> óó ðð6 óó ðò,	õ"õ*$òX
ò 5ð "4×!;Ñ!;ô &TõPOò.òB
$ò,ò:(õJJòX:;òxQ;ñf !à�iÐ Ø�lÐ#ð	
óó:Oóð:OôxJô4<)ô|ô8;ò:P?òdP÷,?.öBDr1   rS   c                ód  € V P                  4       P                  RR7       V P                  4       '       gŠ   \        P                  ! RV\        4       R7      pVP                  \        P                  P                  \        P                  P                  \        P                  ! 4       R7      pV P                  V4       V P                  R4      ;_uu_ 4       p\        P                  ! VP!                  4       R\        4       R7      p\#        V4      uuRRR4       #   + '       g   i     R# ; i)	a—  
This function returns a persistent L{Key}.

The key is loaded from a PEM file in C{location}. If it does not exist, a
key with the key size of C{keySize} is generated and saved.

@param location: Where the key is stored.
@type location: L{twisted.python.filepath.FilePath}

@param keySize: The size of the key, if it needs to be generated.
@type keySize: L{int}

@returns: A persistent key.
@rtype: L{Key}
T)ÚignoreExistingDirectoryi  )Úpublic_exponentr†  r²   )Úencodingr7  Úencryption_algorithmrU   N)Úpasswordr²   )ÚparentÚmakedirsÚexistsr   Úgenerate_private_keyr   r�  r   rŒ  rÉ  r�  rÊ  r‘  Ú
setContentrV   r   rX   rS   )ÚlocationrÌ   Ú
privateKeyÚpemÚkeyFiles   &&   r2   Ú_getPersistentRSAKeyr
    sá   € ð  ‡O�OÓ×Ñ°tÐÔ<ð �?‰?×ÒÜ×-Ò-Ø!¨G¼_Ó=Nô
ˆ
ð ×&Ñ&Ü"×+Ñ+×/Ñ/Ü ×.Ñ.×AÑAÜ!.×!;Ò!;Ó!=ð 'ó 
ˆð 	×Ñ˜CÔ ð 
�‰�t×	Ô	 Ü"×7Ò7Ø�L‰L‹N T´?Ó3Dô
ˆ
ô �:‹÷	 
×	×	Ó	ús   Ã:DÄD/	)i   )Nr/   Ú
__future__r   rf  rº   rC   r«  Úbase64r   r   r   Úhashlibr   r   Útypingr   r¾   Ú
constantlyr	   r
   Úcryptographyr   Úcryptography.exceptionsr   Úcryptography.hazmat.backendsr   Úcryptography.hazmat.primitivesr   r   Ú)cryptography.hazmat.primitives.asymmetricr   r   r   r   r   Ú&cryptography.hazmat.primitives.ciphersr   r   r   Ú,cryptography.hazmat.primitives.serializationr   r   r   Útwisted.conch.sshr   r   Útwisted.conch.ssh.commonr   Útwisted.pythonr   Útwisted.python.compatr   r    Útwisted.python.deprecater!   Ú/cryptography.hazmat.primitives.asymmetric.utilsr"   r#   ÚImportErrorr$   r%   Ú	SECP256R1Ú	SECP384R1Ú	SECP521R1r€   r›   r&  r'  Ú	Exceptionr(   r4   r7   r9   r;   r?   rQ   rS   r
  r)   r1   r2   Ú<module>r"     s?  ðñ
õ #ã Û Û Û ß 6Ñ 6ß Ý ã ß +Ý Ý 4Ý 8ß @ß TÕ Tß LÑ L÷õ ç +Ý 1Ý $ß 9Ý @ð	÷ð ˜BŸLšL›NØ˜BŸLšL›NØ˜BŸLšL›Nð€ð �+Ø�+Ø�+ð€
ð ×+Ñ+Ð Ø×-Ñ-Ð ô�)ô ô ô ô˜	ô ô˜9ô ô$˜ô $ô" 9ô ò÷>|ñ |ö~3(øðW7 ô ÷ñ ðús   Â E ÅE%Å$E%