[Objc] How to get SecKeyRef from base64 coded string

This quick iOS Application Development tip will show you How to get SecKeyRefM from base64 coded string, which for iOS 7 utilises: So, let’s assume that you have a base64 coded public key, like:

MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC3gn+tJ1+PbP0GHa6hmM35WsVyibpypWAwRuBYY4MGfh3VWoXgiyiLo5HJTW1eR9BUFq3z+yOG1rwzSabZ8I4zneWm0kH7xErSjNrMbmjirbL7e6TQNa1ujP/x4x9XVbqf3vIsNVs19kn/qSX/HGzd5Ct3TGAo0AT0T4JwkCfciwIDAQAB

The first thing that you must do, is base64 decode your to NSData:
If you are developing for iOS 7, which by now I hope you would be then you can use this: initWithBase64EncodedString::options Once you have the string decoded as NSData, you can …

Original article: http://feedproxy.google.com/~r/iosdevblog/~3/voI5L_edgtU/


warningImportant note:
this article is automatically grabbed from here. I’m not the owner and the responsible of this post content.

 

Alberto Pasca

Software engineer @ Pirelli & C. S.p.A. with a strong passion for mobile  development, security, and connected things.