Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to do digital signing of my request data which will be sent to the server. My server sends distinct private keys to her clients after authentication and expects all responses to be digitally signed with those keys for next x days. In order to represent a private key instance in iOS it expects a .p12 file with a password input.

Since the private keys change dynamically for every user, I can have a persistent certificate or .p12 on my device to read the private keys. In that case, is it advised to send the .p12 file as part of the JSON response in base 64 format over the wire after authentication, create a .p12 file buffer and do message signing? Is this safe? Or is there any security vulnerability in this approach?

share|improve this question
No one should be sending private keys over the wire. The correct way would be for the client to generate a key pair and do a certificate signing request to the server (e.g. PKCS10), or at the very least simply send its public key to the server (over an authenticated connection for both cases, of course). – user13741 Sep 20 '14 at 23:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.