Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Can't import raw symmetric keys [Mac OS]

#4

-[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.

Reported by snej · April 14th, 2009 @ 06:58 PM

State: resolved
Milestone: 0.3
Assigned to: snej snej

Activity

  1. snej
    snej
    • Tag set to import, mac_os, symmetric

    April 14th, 2009 @ 07:04 PM

  2. snej
    snej
    • State changed from new to open

    April 14th, 2009 @ 07:06 PM

  3. snej
    snej

    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

    I've just asked (again) about this on the apple-cdsa list.

    April 15th, 2009 @ 08:31 AM

  4. snej
    snej
    • 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.

    April 20th, 2009 @ 07:52 AM

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.