Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 21 lines (12 sloc) 1.213 kb
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
Jump to Line
Something went wrong with that request. Please try again.