Get private SecKeyRef from DER file?
- by Alexander Parfyanovich
In my iPhone project I have used this solution to encrypt data with DER encoded certificate, which was generated by openssl commands like this:
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout privateKey.pem -out cert.pem
openssl x509 -outform der -in cert.pem -out cert.der
openssl rsa -in privateKey.pem -outform DER -out privateKey.der
And now I want to decrypt data using private key file. How can I get the private SecKeyRef instance from DER encoded private key file?