How to store private key and distribute public key

Discussion in 'iOS Programming' started by forrestxu, Jul 20, 2008.

  1. macrumors newbie

    Joined:
    May 31, 2008
    #1
    Hi,

    I need your help.

    I am new to IPhone Programming. I produced rsa public key and private key using the code below:

    NSMutableDictionary *myDictionary=[[NSMutableDictionary alloc] init];
    [myDictionary setObject:(id)kSecAttrKeyTypeRSA forKey:(id)kSecAttrKeyType];
    [myDictionary setObject:mad:"512" forKey:(id)kSecAttrKeySizeInBits];
    SecKeyGeneratePair((CFDictionaryRef) myDictionary, &publicKey, &privateKey);

    How do I store privateKey into iphone? save it as a file? how to distribute the publicKey. send it by a file?


    Thank you in advance.

    Forrest
     

Share This Page