Skip to content

Use Traits#378

Merged
tarcieri merged 4 commits into
RustCrypto:masterfrom
tcyrus:add-traits
Jun 16, 2025
Merged

Use Traits#378
tarcieri merged 4 commits into
RustCrypto:masterfrom
tcyrus:add-traits

Conversation

@tcyrus

@tcyrus tcyrus commented Jun 14, 2025

Copy link
Copy Markdown
Contributor
  • Implemented From and TryFrom traits so that DsaPrivateKey, EcdsaPrivateKey, and OpaquePrivateKeyBytes can be created from bytes without needing the encoding::Decode trait (ssh-key doesn't export ssh-encoding, so I had some issues with this).
  • Implemented functions for PrivateKey and PublicKey using std::io::{Write, Read} traits (std only). This allows you to read / write files without needing to provide a path
  • Use AsRef<Path> instead of &Path for PrivateKey and PublicKey

I'd appreciate it if this could be back-ported to 0.6.x. The v0.7.0-rc.0 release isn't working for me.

@tcyrus tcyrus changed the title Add traits Use Traits Jun 14, 2025
@tarcieri

Copy link
Copy Markdown
Member

ssh-key doesn't export ssh-encoding, so I had some issues with this

Surprised to hear that. Opened #379.

The v0.7.0-rc.0 release isn't working for me.

What problems are you having?

@tcyrus

tcyrus commented Jun 15, 2025

Copy link
Copy Markdown
Contributor Author

Just rebuilt my tool and it looks like a basic version conflict.
I thought it was something different, but I guess not.

@tarcieri

tarcieri commented Jun 15, 2025

Copy link
Copy Markdown
Member

@tcyrus I actually noticed a bug in the recent release of the elliptic curve crates and fixed it and cut another release, so hopefully that was the solution

@tarcieri tarcieri merged commit 957d3b5 into RustCrypto:master Jun 16, 2025
14 checks passed
@tcyrus

tcyrus commented Jun 18, 2025

Copy link
Copy Markdown
Contributor Author

Forgot to push this out, but it might be a good idea for read_openssh_file and write_openssh_file to use read_openssh and write_openssh respectively.

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.

2 participants