Skip to content

Public key authentication#1

Merged
ocnc merged 5 commits intoocnc:mainfrom
afds:pub-key-auth
Mar 1, 2026
Merged

Public key authentication#1
ocnc merged 5 commits intoocnc:mainfrom
afds:pub-key-auth

Conversation

@afds
Copy link
Copy Markdown
Contributor

@afds afds commented Feb 23, 2026

Summary

  • Add support for authenticating SSH/Mosh connections using private keys stored in Keychain
  • Implement OpenSSH key import
  • Add key paste UI with real-time validation and derived public key display

Key changes

  • SSHKeyImporter — parses OpenSSH PEM format for Ed25519, P-256, P-384; handles mpint sign-byte stripping
  • ConnectionEditorView — private key paste UI with live validation, error hints, and copy-public-key button
  • SessionManager — loads key from Keychain and builds NIOSSHPrivateKey for connect/resume flows
  • MoshSessionState — persists auth method type to support key-based session resumption

Tests

Test cases in SSHKeyImporterTests covering synthetic keys, real ssh-keygen keys, mpint edge cases, and error paths for all three key types.

@afds afds changed the title Public key auth Add SSH public key authentication Feb 23, 2026
@afds afds changed the title Add SSH public key authentication Add public key authentication Feb 23, 2026
@afds afds changed the title Add public key authentication Public key authentication Feb 23, 2026
Collapse three redundant switch blocks in validatePrivateKey() into one.
Show "Private key stored" with a Replace button instead of loading
the PEM back into the editor. Matches password auth behavior where
the credential is not re-displayed.
@ocnc
Copy link
Copy Markdown
Owner

ocnc commented Mar 1, 2026

Thanks for the PR @afds 🥇. Will be pushing out an app store release for today

@ocnc ocnc merged commit 4b7e5c1 into ocnc:main Mar 1, 2026
1 check passed
@ocnc ocnc mentioned this pull request Mar 1, 2026
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