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.
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: http://blog.wingsofhermes.org/?p=42 and http://blog.wingsofhermes.org/?p=75):
+(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 http://blog.wingsofhermes.org/?p=42 and http://blog.wingsofhermes.org/?p=75):
+(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
ios-certificate--key--and-trust-sample-project's People