Struct makiko::host_file::EntryBuilder
source · pub struct EntryBuilder { /* private fields */ }
Expand description
Builder that can be used to add entries to a File
.
You can obtain an instance of the builder using File::entry_builder()
.
Implementations§
source§impl EntryBuilder
impl EntryBuilder
sourcepub fn revoke(&mut self) -> &mut Self
pub fn revoke(&mut self) -> &mut Self
Marks the entries as revoked (using @revoked
).
This means that the given hostnames must not use the given keys.
sourcepub fn plaintext_hostname(&mut self, hostname: &str) -> &mut Self
pub fn plaintext_hostname(&mut self, hostname: &str) -> &mut Self
Adds a given hostname in plaintext.
See host_port_to_hostname()
for the format of the hostname
; you can use
plaintext_host_port()
to add a (host, port)
pair.
The hostname will be added in plaintext, so anybody who has access to known_hosts
can see
which hostnames you connected to. See hostname()
if you want to hide
the hostname.
sourcepub fn plaintext_host_port(&mut self, host: &str, port: u16) -> &mut Self
pub fn plaintext_host_port(&mut self, host: &str, port: u16) -> &mut Self
Adds a given host and port in plaintext.
The host and port will be added in plaintext, so anybody who has access to known_hosts
can see which hostnames you connected to. See hostname()
if you want
to hide the hostname.
sourcepub fn hostname(&mut self, hostname: &str) -> &mut Self
pub fn hostname(&mut self, hostname: &str) -> &mut Self
Adds a given hostname in a hashed form.
See host_port_to_hostname()
for the format of the hostname
; you can use
plaintext_host_port()
to add a (host, port)
pair.
The hostname will be stored in the file as a HMAC-SHA1 hash with a random salt. This hides the hostname if the file is disclosed.
sourcepub fn host_port(&mut self, host: &str, port: u16) -> &mut Self
pub fn host_port(&mut self, host: &str, port: u16) -> &mut Self
Adds a given host and port in a hashed form.
The host and port will be stored in the file as a HMAC-SHA1 hash with a random salt. This hides the host and port if the file is disclosed.
sourcepub fn key(&mut self, pubkey: Pubkey) -> &mut Self
pub fn key(&mut self, pubkey: Pubkey) -> &mut Self
Adds a public key.
We will generate an entry for every combination of a hostname (added by
plaintext_hostname()
, hostname()
and
other methods) and a public key added by this method.
Trait Implementations§
source§impl Clone for EntryBuilder
impl Clone for EntryBuilder
source§fn clone(&self) -> EntryBuilder
fn clone(&self) -> EntryBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more