/usr/lib/python3/dist-packages/twisted/conch/ssh/__pycache__
Edit: /usr/lib/python3/dist-packages/twisted/conch/ssh/__pycache__/keys.cpython-310.pyc (49881B)
o
bV @ s d Z ddlZddlZddlZddlZddlZddlmZmZm Z ddl
mZmZ ddl
Z
ddlmZ ddlmZ ddlmZ ddlmZmZ dd lmZmZmZmZmZ dd
lmZmZm Z ddl!m"Z"m#Z# ddl$m%Z&m'Z( dd
l)m*Z* ddl+m,Z, ddl-m.Z.m/Z/ ddl0m1Z1 ddl2m3Z3 ddl4m5Z5m6Z6 ddl7m8Z8m9Z9 ddl:m;Z; z
ddl
Z> W n e?y ddl Y nw eB eC eD dZEddddZFG dd deGZHG dd deGZIG d d! d!eGZJG d"d# d#e9ZKG d$d% d%eGZLd&d' ZMG d(d) d)ZNd-d+d,ZOdS ).z0
Handling of RSA, DSA, ECDSA, and Ed25519 keys.
N) b64encodedecodebytesencodebytes)md5sha256)utils)InvalidSignature)default_backend)hashes
serialization)dsaeced25519paddingrsa)Cipher
algorithmsmodes)load_pem_private_keyload_ssh_public_key)decoderencoder)PyAsn1Error)univ)commonsexpy)int_to_bytes) randbytes) iterbytesnativeString)
NamedConstantNames)_mutuallyExclusiveArguments)decode_dss_signatureencode_dss_signature)decode_rfc6979_signatureencode_rfc6979_signature)s ecdsa-sha2-nistp256s ecdsa-sha2-nistp384s ecdsa-sha2-nistp521s nistp256s nistp384s nistp521)s secp256r1s secp384r1s secp521r1c @ e Zd ZdZdS )BadKeyErrorzj
Raised when a key isn't what we expected from it.
XXX: we really need to check for bad keys
N__name__
__module____qualname____doc__ r. r. 8/usr/lib/python3/dist-packages/twisted/conch/ssh/keys.pyr( F r( c @ r' )EncryptedKeyErrorzb
Raised when an encrypted key is presented to fromString/fromFile without
a password.
Nr) r. r. r. r/ r1 N r0 r1 c @ r' )BadFingerPrintFormatzS
Raises when unsupported fingerprint formats are presented to fingerprint.
Nr) r. r. r. r/ r2 U r0 r2 c @ s e Zd ZdZe Ze ZdS )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{twisted.python.constants.NamedConstant}
@cvar SHA256_BASE64: Named constant representing fingerprint format
generated using sha256[RFC4634] algorithm in base64 encoding
@type SHA256_BASE64: L{twisted.python.constants.NamedConstant}
N)r* r+ r, r- r MD5_HEX
SHA256_BASE64r. r. r. r/ r3 [ s
r3 c @ r' )PassphraseNormalizationErrorz
Raised when a passphrase contains Unicode characters that cannot be
normalized using the available Unicode character database.
Nr) r. r. r. r/ r6 l r0 r6 c C s8 t | trtdd | D rt td| dS | S )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}
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 s s | ]
}t |d kV qdS )CnN)unicodedatacategory).0cr. r. r/