Skip to content

ssh-encoding: add Decoder constructors for bytes, Base64, and PEM - #663

Merged
tarcieri merged 1 commit into
masterfrom
ssh-encoding/decoder-constructors-and-type-aliases
Dec 4, 2026
Merged

tarcieri merged 1 commit into
masterfrom
ssh-encoding/decoder-constructors-and-type-aliases

Conversation

@tarcieri

@tarcieri tarcieri commented Dec 4, 2026

Copy link
Copy Markdown
Member

Add from_bytes, from_base64, and from_pem so callers can pass borrowed input directly to Decoder. The Base64 and PEM constructors wrap the existing incremental readers and apply the 128 MiB limit to the decoded length.

Export Base64Decoder and PemDecoder for use in type signatures. Expose pem_label() so callers can check the document type before reading its body. Use the new constructors in ssh-key and the ssh-encoding examples.

Add `from_bytes`, `from_base64`, and `from_pem` so callers can pass
borrowed input directly to `Decoder`. The Base64 and PEM constructors
wrap the existing incremental readers and apply the 128 MiB limit to
the decoded length.

Export `Base64Decoder` and `PemDecoder` for use in type signatures.
Expose `pem_label()` so callers can check the document type before
reading its body. Use the new constructors in `ssh-key` and the
`ssh-encoding` examples.
@tarcieri
tarcieri merged commit a046677 into master Dec 4, 2026
21 checks passed
@tarcieri
tarcieri deleted the ssh-encoding/decoder-constructors-and-type-aliases branch December 4, 2026 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant