0

Is there any way to import PFX/p12 file to smartcard programmatically using swift/Objective C?

Actually, I am able to extract the certificate from certificate chain(.p7b). Then instead of saving the certificate into mac's keychain, i want to import the certificate to smartcard programmatically.

I am able to add the certificate to mac's keychain using SecItemAdd. How can i import the certificate to smartcard using swift?

ahad alam
  • 69
  • 7
  • How are you connecting the smart card reader? And to what device? I’m assuming a Mac but need to confirm since there are iPhone readers as well. – valosip Jul 09 '23 at 06:07
  • I am using Safenet eToken. The token is connected to Mac. It's may be possible by creating an object of various attributes. I'm trying to use safenet sdk's library following https://thalesdocs.com/gphsm/ptk/5.9.1/docs/Content/PDF/PTK-C_Programming.pdf documentation. – ahad alam Jul 09 '23 at 06:15
  • My trial is described in below linked question https://stackoverflow.com/questions/76619637/getting-cka-template-inconsistent-while-importing-certificate-using-swift-and-sa – ahad alam Jul 09 '23 at 06:28
  • Smart cards and tokens are notoriously picky, what actions they allow. Its quite probable, that you need a special access right to write even a public key onto them, for a private key it is practically certain. Unfortunately details have to be provided by the token/card issuer. – guidot Jul 09 '23 at 14:37

0 Answers0