Uploaded image for project: 'EJBCA'
  1. EJBCA
  2. ECA-8406

Give a proper error message when using an attributes file for Client Toolbox in EJBCA

    Details

    • Provenance:
      Internal Delivery
    • Sprint:
      EJBCA Team Bob - 2019 w31

      Description

      When using a custom attributes file is being used in Client Toolbox, the library and slot reference must be specified.

      This means that the attribute file should look something like:

      name=nfast-java
      library=/opt/nfast/toolkits/pkcs11/libcknfast.so
      slotListIndex=0
      attributes(*) = {
        BLAH = true
        MORE_BLAH = false
      }
      

      However, when a custom attribute file is used in EJBCA, library and slot reference is picked from the crypto token, and should not be specified in the attibutes file.

      This means that the attribute file only would contain:

      attributes(*) = {
        BLAH = true
        MORE_BLAH = false
      }
      

      If you give an attributes file a la Client Toolbox in EJBCA, you a non-sense message like "Slot not initalized" in the GUI and the log will tell something like:

      2019-07-08 16:00:47,671 DEBUG [org.cesecore.keys.token.p11.Pkcs11SlotLabel] (default task-17) Using SUN PKCS11 provider: sun.security.pkcs11.SunPKCS11
      2019-07-08 16:00:47,671 ERROR [org.cesecore.keys.token.p11.Pkcs11SlotLabel] (default task-17) Error constructing pkcs11 provider: null
      [...]
      Caused by: java.security.ProviderException: Error parsing configuration
              [...]
      Caused by: sun.security.pkcs11.ConfigurationException: name must only be specified once, line 4
      	[...]
      

      Give a proper error message, to help the user understand what they did wrong.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              bastianf Bastian Fredriksson
              Reporter:
              bastianf Bastian Fredriksson
              Verified by:
              Tomas Gustavsson
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours
                  2h