Re: Creating OpenSSH compatible key pairs
Re: Creating OpenSSH compatible key pairs
- Subject: Re: Creating OpenSSH compatible key pairs
- From: Jens Alfke via Cocoa-dev <email@hidden>
- Date: Sat, 11 Apr 2020 13:20:07 -0700
The Sec* APIs are a world of pain. Of anything I’ve ever programmed in, um, 42
years, they are the ones that have gotten me closest to throwing my computer
through a window in a rage. (Runner-up: CoreAudio.) They’re very vague and
poorly documented, and their capabilities and behaviors vary greatly between
Mac and iOS devices and even the iOS Simulator.
It’s been a few years since I delved into them, so I can’t help as much as I’d
like. A few thoughts:
- Shouldn’t you be using SecKeyCreatePair to create a key-pair?
- The header at the top of the PEM data you’ll probably just have to edit
yourself.
- The incorrect data is probably a result of using different encoding/padding
than what SSH uses.
- Have you considered just using NSTask to call the ssh-keygen tool? If you
don’t want to go down the crypto rabbit-hole, this might save you a lot of pain.
—Jens
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden