0

I have a pretty simple use case. The user of my web application should be able to sign outputs on certain workflow steps. The website is secured via mutual ssl, so when a user signs in he is prompted to pass his certificate. This works fine, so I know, that the browser can access the certificates (from the PKI Card via Firefox's crypto-module or the Windows' keystore in Chrome). From that point it should be easy to use a user's certificates from within the browser. But it seems that there is no an obvious way.

What I tried:

google

There are some StackOverflow questions (but all seem to be old):

webcrypto api

This API seems to be great. Also that use case seems to be exact what I need. But the final implementation seems not have that capabilities

pkijs

As webcrpypto api exactly that capability seems not to be implemented

webcrypto key discovery

Is that the missing link? I'm not sure....

Why a new question? As we have 2020 now, the older questions and answers contain a lot of outdated stuff (active-x, java-applets), so I hope that we can get a clear and obvious answer making it possible without any workarounds.

Update: I'm afraid it's still impossible: https://techblog.bozho.net/electronic-signatures-using-the-browser/

amanbolat
  • 81
  • 1
  • 12
gratinierer
  • 1,748
  • 1
  • 10
  • 10
  • You cannot get the certificate from the host system using JavaScript. You would need something with filesystem access. It would be possible to run a program on the host pc that sends the certificate as PEM to a chrome extension that can interact with your website, but that would require the user to install the program that gets the cert and the extension that uses it. – Moritz Roessler Jun 16 '20 at 13:24
  • Apparently you can [access smartcards using a chrome extension only](https://stackoverflow.com/a/55755768/1487756) – Moritz Roessler Jun 16 '20 at 13:26
  • Please look at https://fortifyapp.com/. It allows to get and use certificates from system storage and PKCS#11 tokens. Here is an example of how to create CMS package using Fortify application https://codesandbox.io/s/fortify-demo-2b9x8 – Microshine Jun 29 '20 at 08:00
  • I need to do the same. Did you finally succeed ? – Fabske Dec 09 '21 at 17:44
  • No, i gave it up without a solution. – gratinierer Dec 10 '21 at 21:27

0 Answers0