Im looking to use a private key with API's the only issue is how to hold/accure the private key at least on the first run becuase after i can have it inside keychain
the best approach i see is having a p12 file and using SecPKCS12Import i can import it.
but again a p12 file would need a password which will then have to be in the application so we are back to square one
In other words is it possible to have a kind of certificate inside the application and only the application it self can use/open ?
The approach taken in most companies is to not hold the secret key in the repo as opposed to the app.
Most of the time the keys are injected during some automated build process and we rely on code obfuscation to hide it from potential threats.
However it is impossible to hide keys from decompilers completely. The only way to do it would be to not use any third party library and instead rely on the BE to facilitate the communication to any third party.