Use of digital certificate A1 installed on the server

1

I work with the development of a Java Web application for electronic medical records management, in which it is necessary to digitally sign XML documents.

This application is used by more than 200 users within the hospital environment and these users use several different computers to access it.

When we started development, we chose to use A3 certificates precisely because the user used different machines to access the system. At the time the best way we found to do this was through Java Web Start.

However, recently I was informed that it might be possible to place A1 digital certificates directly on the web server, which would greatly facilitate the hospital's activities, especially in relation to costs.

Some similar questions have already been answered, such as here , but I did not quite understand if this is the case I am dealing with.

Thus:

  • Is it possible to import A1 certificates from all users and store them directly on the server? (I know that it is not possible to convert the existing A3 to A1)
  • In this case, will users only need to enter their PIN to sign the documents?
  • In addition, at the time of signing will the system display all +200 certificates stored for the user to choose yours and enter the PIN?
  • asked by anonymous 29.05.2018 / 20:20

    2 answers

    1

    First, a brief summary of how certificates work and the digital signature. At the end of the answer I left references, after all it is a complex subject and the details would not fit here.

    In general, we are talking about public key cryptography, in which there is a pair of keys: a public key and a private key (see the links at the end for more details).

    The certificate only contains the public key. The private key (which is used to digitally sign) is separate from the certificate, it is two different things (although related, since the public key of the certificate is used to verify the signature made with your private key).

    In the case of A3, both the certificate and your private key are stored on some physical media (a card, token, whatever), and access to the private key is password protected (the PIN you type when you go use it).

    In the case of A1, the only difference is that it is not stored in a media, but in a file. The most common formats are the keystore (JKS) and PKCS12 (pfx files, most common in Windows).

    Both work in a similar way: they have several different entries, identified by some name (called an "alias"). And in each alias, you can have a certificate, or the certificate + private key. This file is usually password protected (it can be configurable, depending on the way you create these files) - the java.security.KeyStore class, for example, allows you to create and manipulate both types (JKS and pfx).

    Now let's ask the questions:

      

    Is it possible to import A1 certificates from all users and store them directly on the server?

    Yes, as long as you also store the private keys (as they are used to digitally sign). You can store everything in a single keystore, and use different aliases for each client, or use a separate keystore for each one. Where are the files will depend on your solution (they can be blobs in the bank, files in some folder of the server, etc.).

    As it is recommended that kesytore has a password, the user will have to enter it to access their respective private key when signing the document.

      

    Will users only need to enter their PIN to sign the documents?

    If the only use they make of the private key is at the time of signing, then yes, only then will it be necessary to enter the PIN.

    If the private key is not used for anything else (for example, to authenticate to the site using the certificate), then signing would be the only time the password is required.

    But it has a detail: as the certificate + private key are on the server, your system will have to cause the user to enter the password (through some interface, via form, etc), since all access to kesytore and signing will be done on the server, since that is where the private keys are.

    This is different from when the certificate is installed on the client machine, because in this case, the broswer / OS does the middle of the field and asks for the password automatically.

      

    In addition, at the time of signing the system will display all +200 certificates stored for the user to choose yours and enter the PIN?

    If the certificate is on the server, then you can control what the user can see. Your application could only load the certificates of that user, since probably he should not even see the others (it's how I imagine it is your system).

    References:

    • Digital signature: link
    • Public Key Certificates and Encryption: link
    30.05.2018 / 14:23
    -1

    Yes, you can store the allowed certificates on your whitelist (keystore) that will be read by your apache. You configure it in the same xml that configures apache SSL or HTTPS access and provides the server certificate, below documentation:

    https://www.ibm.com/support/knowledgecenter/pt-br/SS4GSP_6.2.7/com.ibm.udeploy.install.doc/topics/ssl_config_server_bds.htm
    

    l And as far as I know, the user will have a list of certificates installed in the browser to select his and enter the password.

        
    29.05.2018 / 20:30