Skip to content

fix(ed25519): support writing Ed25519 private keys - #2731

Open
Yshuro wants to merge 1 commit into
paramiko:mainfrom
Yshuro:fix/issue-2700
Open

Yshuro wants to merge 1 commit into
paramiko:mainfrom
Yshuro:fix/issue-2700

Conversation

@Yshuro

@Yshuro Yshuro commented Nov 20, 2026

Copy link
Copy Markdown

Summary

Fixes AttributeError: 'Ed25519Key' object has no attribute 'private_key' when calling write_private_key_file or write_private_key on an Ed25519Key instance.

Ed25519Key stores its underlying Cryptography signing key under _signing_key. This PR:

  1. Adds a private_key property on Ed25519Key that aliases _signing_key for parity with other PKey classes.
  2. Overrides write_private_key_file and write_private_key on Ed25519Key to default file_format=OPENSSH (since cryptography's Ed25519PrivateKey only supports OpenSSH or PKCS8 format, not traditional PEM).
  3. Adds unit tests for writing unencrypted and encrypted Ed25519 private keys.

Fixes #2700

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.

[BUG] - Error writing Ed25519Key to file

1 participant