Skip to content

SshWireWriter

[Source]

Accumulates SSH wire format bytes. Call val_bytes() to get the final val bytes.

class ref SshWireWriter

Constructors

create

[Source]

new iso create()
: SshWireWriter iso^

Returns


Public Functions

write_byte

[Source]

fun ref write_byte(
  value: U8 val)
: None val

Parameters

  • value: U8 val

Returns


write_bool

[Source]

fun ref write_bool(
  value: Bool val)
: None val

Parameters

Returns


write_u32

[Source]

fun ref write_u32(
  value: U32 val)
: None val

Parameters

  • value: U32 val

Returns


write_string

[Source]

SSH string: uint32 length followed by data bytes.

fun ref write_string(
  value: Array[U8 val] val)
: None val

Parameters

Returns


write_string_from_str

[Source]

SSH string from Pony String.

fun ref write_string_from_str(
  value: String val)
: None val

Parameters

Returns


write_name_list

[Source]

SSH name-list: comma-separated string.

fun ref write_name_list(
  names: Array[String val] val)
: None val

Parameters

Returns


write_mpint

[Source]

SSH mpint: uint32 length + big-endian two's-complement bytes. The value is first canonicalized (redundant leading 0x00 bytes stripped) so the encoding matches every other implementation's — OpenSSH canonicalizes, and a non-canonical encoding of the X25519 shared secret would make the exchange hash disagree. A single leading zero is then re-added only when the high bit is set, to keep the value non-negative.

fun ref write_mpint(
  value: Array[U8 val] val)
: None val

Parameters

Returns


val_bytes

[Source]

Collect all chunks into a single contiguous Array[U8] val.

fun ref val_bytes()
: Array[U8 val] val

Returns