https://developer.apple.com/library/mac/samplecode/CryptoCompatibility/Introduction/Intro.html