¡@

Home 

2014/10/15 ¤U¤È 10:12:55

iphone Programming Glossary: privatekey

Iphone - How to encrypt NSData with public key and decrypt with private key?

http://stackoverflow.com/questions/10072124/iphone-how-to-encrypt-nsdata-with-public-key-and-decrypt-with-private-key

UIKit UIKit.h #import Security Security.h @interface ViewController UIViewController SecKeyRef publicKey SecKeyRef privateKey NSData publicTag NSData privateTag void encryptWithPublicKey uint8_t plainBuffer cipherBuffer uint8_t cipherBuffer void.. uint32_t PADDING kSecPaddingNone static const UInt8 publicKeyIdentifier com.apple.sample.publickey static const UInt8 privateKeyIdentifier com.apple.sample.privatekey @implementation ViewController SecKeyRef getPublicKeyRef OSStatus sanityCheck noErr.. NSLog @ FINAL decrypted text s plainBuffer SecKeyRef getPrivateKeyRef OSStatus resultCode noErr SecKeyRef privateKeyReference NULL NSData privateTag NSData dataWithBytes @ ABCD length strlen const char @ ABCD if privateKey NULL self generateKeyPair..

RSA implementations in Objective C

http://stackoverflow.com/questions/10222524/rsa-implementations-in-objective-c

UIKit UIKit.h #import Security Security.h @interface ViewController UIViewController SecKeyRef publicKey SecKeyRef privateKey NSData publicTag NSData privateTag void encryptWithPublicKey uint8_t plainBuffer cipherBuffer uint8_t cipherBuffer void.. uint32_t PADDING kSecPaddingNone static const UInt8 publicKeyIdentifier com.apple.sample.publickey static const UInt8 privateKeyIdentifier com.apple.sample.privatekey @implementation ViewController SecKeyRef getPublicKeyRef OSStatus sanityCheck noErr.. NSLog @ FINAL decrypted text s plainBuffer SecKeyRef getPrivateKeyRef OSStatus resultCode noErr SecKeyRef privateKeyReference NULL NSData privateTag NSData dataWithBytes @ ABCD length strlen const char @ ABCD if privateKey NULL self generateKeyPair..

Extracting a public key from key pair in key chain

http://stackoverflow.com/questions/11467215/extracting-a-public-key-from-key-pair-in-key-chain

NSString privateIdentifier NSLog @ begin generating key... OSStatus status noErr NSMutableDictionary privateKeyAttr NSMutableDictionary alloc init NSMutableDictionary publicKeyAttr NSMutableDictionary alloc init NSMutableDictionary.. NSData privateTag privateIdentifier dataUsingEncoding NSUTF8StringEncoding SecKeyRef publicKey NULL SecKeyRef privateKey NULL keyPairAttr setObject __bridge id kSecAttrKeyTypeRSA forKey __bridge id kSecAttrKeyType keyPairAttr setObject NSNumber.. __bridge id kSecAttrKeyType keyPairAttr setObject NSNumber numberWithInt bits forKey __bridge id kSecAttrKeySizeInBits privateKeyAttr setObject NSNumber numberWithBool YES forKey __bridge id kSecAttrIsPermanent privateKeyAttr setObject privateTag forKey..

How To Use OAuth in My iPhone App?

http://stackoverflow.com/questions/6513363/how-to-use-oauth-in-my-iphone-app

GTMOAuthAuthentication alloc initWithSignatureMethod kGTMOAuthSignatureMethodHMAC_SHA1 consumerKey myConsumerKey privateKey myConsumerSecret autorelease setting the service name lets us inspect the auth object later to know what service it is for..