Can't import raw symmetric keys [Mac OS]
Reported by snej | April 14th, 2009 @ 06:58 PM | in 0.3
-[MYSymmetricKey initWithKeyData:algorithm:]
is
unimplemented on Mac OS.
I haven't found a way to create a MYSymmetricKey object from an existing raw key (just the pure key bits). I can pass the data to SecKeyImport, but there's no way to tell it what algorithm to use, so it can't create a valid key.
Comments and changes to this ticket
-
snej April 14th, 2009 @ 07:04 PM
- Tag set to import, mac_os, symmetric
-
snej April 14th, 2009 @ 07:06 PM
- State changed from new to open
-
snej April 15th, 2009 @ 08:31 AM
Doug Mitchell of Apple acknowledges the problem, in 2005, and suggests using CSSM_UnwrapKey.
The Keychain.framework code has a method
-[Keychain addKey:]
that appears to do this ... it's 400 lines long, though. :-P -
snej April 20th, 2009 @ 07:52 AM
- Milestone set to 0.3
- State changed from open to resolved
Fixed in 0.3.
I had to use an undocumented/SPI function, SecKeyCreate. Not ideal, but there wasn't a reasonable workaround. I've at least marked it as weak-linked, so apps using MYCrypto will still run if this function ever disappears from Security.framework in the future.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.