Can't import raw symmetric keys [Mac OS]
Reported by snej | 2009-04-14 18:58:52 UTC | 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 2009-04-14 19:04:29 UTC
- Tag set to import, mac_os, symmetric
-

snej 2009-04-14 19:06:08 UTC
- State changed from new to open
-

snej 2009-04-15 08:31:45 UTC
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 2009-04-20 07:52:26 UTC
- 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.