This project derives content heavily from iOS Certificate, Key, and Trust Programming guide. It's primary purpose is to give the user the ability to quickly import/export RSA private keys from the keychain to the console.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


This iOS 4.3 project was created in Xcode 4.  The most important class in this project is "Crypto".  It contains the following functions in its public interface:

These functions are slightly modified (fixing typos) from functions given in Apple's Certificate, Key, and Trust Programming Guide:

+(void)generateKeyPairWithPublicTag:(NSString *)publicTagString privateTag:(NSString *)privateTagString;

The following methods are designed to import PEM formatted RSA keys from strings and place in your keychain (slightly modified from these wonderful resources: and

+(void)setPrivateKey:(NSString *)pemPrivateKeyString tag:(NSString *)tag;
+(void)setPublicKey:(NSString *)pemPublicKeyString tag:(NSString *)tag;

// These methods are here to export RSA keys from keychain to strings in PEM format (Also taken from and

+(NSString *)getX509FormattedPublicKey:(NSString *)tag;
+(NSString *)getPEMFormattedPrivateKey:(NSString *)tag;

// Method to remove key from keychain:

+(void)removeKey:(NSString *)tag;

// See ViewController viewDidLoad method for example usage