Go to the latest version of this document.
search in docstrings

Search bar offers the following options:

- Term presence. The below example searches for documents that must contain “foo”, might contain “bar” and must not contain “baz”: `+foo bar -baz`
- Wildcards. The below example searches for documents with words beginning with “foo”: `foo*`
- Search in specific fields. The following search matches all objects in "twisted.mail" that matches “search”: `+qname:twisted.mail.* +search`

  Possible fields: 'name', 'qname' (fully qualified name), 'docstring', and 'kind'. Last two fields are only applicable if "search in docstrings" is enabled.

- Fuzzy matches. The following search matches all documents that have a word within 1 edit distance of “foo”: `foo~1`

Results provided by Lunr.js

# ``twisted`.`conch`.`client`.`knownhosts`.`HashedEntry``

class documentation

`class HashedEntry(_BaseEntry, FancyEqMixin): (source)`

Implements interfaces: `twisted.conch.interfaces.IKnownHostEntry`

View In Hierarchy

A `HashedEntry` is a representation of an entry in a known_hosts file where the hostname has been hashed and salted.

Class Method | `fromString` | Load a hashed entry from a string representing a line in a known_hosts file.
Method | `__init__` | Undocumented
Method | `matchesHost` | Implement `IKnownHostEntry.matchesHost` to compare the hash of the input to the stored hash.
Method | `toString` | Implement `IKnownHostEntry.toString` by base64-encoding the salt, host hash, and key.
Constant | `MAGIC` | the 'hash magic' string used to identify a hashed line in a known_hosts file as opposed to a plaintext one.
Class Variable | `compareAttributes` | Undocumented
Instance Variable | `_hostHash` | the hashed representation of the hostname.
Instance Variable | `_hostSalt` | the salt to combine with a hostname for hashing.

Inherited from `_BaseEntry`:

Method | `matchesKey` | Check to see if this entry matches a given key object.
Instance Variable | `comment` | Trailing garbage after the key line.
Instance Variable | `keyType` | The type of the key; either ssh-dss or ssh-rsa.
Instance Variable | `publicKey` | The server public key indicated by this line.

Inherited from `FancyEqMixin` (via `_BaseEntry`):

Method | `__eq__` | Undocumented
Method | `__ne__` | Undocumented

@classmethod
def fromString(cls, string): (source)

Load a hashed entry from a string representing a line in a known_hosts file.

Parameters
string:`bytes` | A complete single line from a known_hosts file, formatted as defined by OpenSSH.
Returns
The newly created `HashedEntry` instance, initialized with the information from `string`.
Raises
`DecodeError` | if the key, the hostname, or the is not valid encoded as valid base64
`InvalidEntry` | if the entry does not have the right number of elements and is therefore invalid, or the host/hash portion contains more items than just the host and hash.
`BadKeyError` | if the key, once decoded from base64, is not actually an SSH key.

def __init__(self, hostSalt, hostHash, keyType, publicKey, comment): (source)
overrides `twisted.conch.client.knownhosts._BaseEntry.__init__`

Undocumented

def matchesHost(self, hostname): (source)
from `twisted.conch.interfaces.IKnownHostEntry`

Implement `IKnownHostEntry.matchesHost` to compare the hash of the input to the stored hash.

Parameters
hostname:`bytes` | A hostname or IP address literal to check against this entry.
Returns
`bool` | `True` if this entry is for the given hostname or IP address, `False` otherwise.

def toString(self): (source)
from `twisted.conch.interfaces.IKnownHostEntry`

Implement `IKnownHostEntry.toString` by base64-encoding the salt, host hash, and key.

Returns
`bytes` | The string representation of this entry, with the hostname part hashed.

MAGIC: `bytes` = (source)

the 'hash magic' string used to identify a hashed line in a known_hosts file as opposed to a plaintext one.

Value

    b'|1|'

compareAttributes: `tuple[str, ...]` = (source)
overrides `twisted.python.util.FancyEqMixin.compareAttributes`

Undocumented

_hostHash = (source)

the hashed representation of the hostname.

_hostSalt = (source)

the salt to combine with a hostname for hashing.