0

as you know, there is no pkcs7 sign in ios, so in backend with nodejs we must convert to pkcs7 for another service call which only accept pkcs7 and it's not in our company. in our sever we have that string which ios sign and certificate and we receive pkcs1 sign from ios , i use node-forge but it does not work in backend I only have certificate and pkcs1 signature, which signs a string text, how can I convert pkcs1 to pkcs7 signature using node js? if there is other solution rather than nodejs, also may help

I tried node-forge, but it want private key which I don't have in server-side, I wanna do this without private key

Faraz
  • 69
  • 1
  • 8
  • I'm afraid your question does not make any sense. PKCS1 is a cryptographic standard defining RSA while PKCS7 defines CMS (Cryptographic Message Syntax). – veebee Jan 23 '23 at 14:28
  • yes i know، but our middleware only support pkcs7 and ios devices does not support it. and i should resolve it on server side – Faraz Jan 24 '23 at 15:15
  • So you have an ios device and a back-end component running on NodeJS? Could you rephrase your question and explain a bit more how those work together? The string text is signed on the iOS device, right? Using which library, and how? – veebee Jan 25 '23 at 05:57
  • i update my question. it's exactly as you said, but i don't know what happen in ios , i only receive final signature in pkcs1 format in a post request – Faraz Jan 26 '23 at 14:58
  • Could you provide a sample? – veebee Jan 27 '23 at 07:45
  • you mean example of my pkcs1 signature? and a valid pkcs 7? – Faraz Jan 29 '23 at 06:20
  • An example of a PKCS1 signature generated from your code. – veebee Jan 30 '23 at 06:28
  • let pkcs1 = `mwakqstwSik0w5dao49VfP78zHsg9jA5ZrqsgmHSEiOgUM6lCoqJJnB/4MfdVU95yhioPkNfjlU9 Kr6rowtaYZN1OLtVVY3Ta5lUIT+aOt/v4UdZthY3IMuRF+r7xY50Cdh/f7/1YEOG0F0GbgcQkT+F y8+Hm0ysEaZagZC2T5a5g6j+Hjz1zJ545ycBYC182gyTanZ8GmvfDGfBZAuMCFdKJ64eVkJJjxcs buzr1I3IoJh5ymBMSY1GDqPc3HQpR0q/cSMA7JZSmtCVCoooZnC+hmh1PcsdVIbNFUOU9GB9/nBh P2HCvgTG5sQz6KaTDnjDnkQE+jR0Yt50WGyFsw==` – Faraz Jan 30 '23 at 10:20
  • Which cipher are you using to generate this ? Can you also share the source code ? – veebee Jan 30 '23 at 10:27
  • the pkcs1 generated in ios devices , and i only receive it in request , don't know anything about their code – Faraz Jan 30 '23 at 18:20

0 Answers0