You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OpenSSHPrivateKeyUtil.encodePrivateKey does not work with ECDSA key pairs #2240
OpenSSHPrivateKeyUtil.encodePrivateKey does work fine for Ed25519.
It doesn't work for RSA either, but I'm not sure whether it's supposed to, as RSA is supposed to be packed in a different PEM wrapper (which has -----BEGIN PRIVATE KEY----- instead of -----BEGIN OPENSSH PRIVATE KEY-----).
Activity
dghgit commentedon May 4, 2026
I think this is now fixed. Please try what's on https://www.bouncycastle.org/betas
generalized openSSH ECDSA key encoding, relates to github #2240
AlainKnaff commentedon May 4, 2026
Indeed, it works now for ECDSA with new ECGenParameterSpec("secp256r1"), thanks.
It also works with RSA, by bracketing it with -----BEGIN RSA PRIVATE KEY----- and -----END RSA PRIVATE KEY----- rather than BEGIN OPENSSH PRIVATE KEY
Many thanks,
Alain