code: @Nonnull
    public static LoadedKeyStore loadKeyStore (@Nonnull final IKeyStoreType aKeyStoreType,
                                               @Nullable final String sKeyStorePath,
                                               @Nullable final String sKeyStorePassword)
    {
      ValueEnforcer.notNull (aKeyStoreType, "KeyStoreType");
  
      // Get the parameters for the key store
      if (StringHelper.hasNoText (sKeyStorePath))
        return new LoadedKeyStore (null, EKeyStoreLoadError.KEYSTORE_NO_PATH);
  
      KeyStore aKeyStore = null;
      // Try to load key store
      try
      {
        aKeyStore = loadKeyStoreDirect (aKeyStoreType, sKeyStorePath, sKeyStorePassword);
      }
      catch (final IllegalArgumentException ex)
      {
        if (LOGGER.isWarnEnabled ())
          LOGGER.warn ("No such key store '" + sKeyStorePath + "': " + ex.getMessage (), ex.getCause ());
  
        return new LoadedKeyStore (null,
                                   EKeyStoreLoadError.KEYSTORE_LOAD_ERROR_NON_EXISTING,
                                   sKeyStorePath,
                                   ex.getMessage ());
      }
      catch (final Exception ex)
      {
        final boolean bInvalidPW = ex instanceof IOException && ex.getCause () instanceof UnrecoverableKeyException;
  
        if (LOGGER.isWarnEnabled ())
          LOGGER.warn ("Failed to load key store '" + sKeyStorePath + "': " + ex.getMessage (),
                       bInvalidPW ? null : ex.getCause ());
  
        return new LoadedKeyStore (null,
                                   bInvalidPW ? EKeyStoreLoadError.KEYSTORE_INVALID_PASSWORD
                                              : EKeyStoreLoadError.KEYSTORE_LOAD_ERROR_FORMAT_ERROR,
                                   sKeyStorePath,
                                   ex.getMessage ());
      }
  
      // Finally success
      return new LoadedKeyStore (aKeyStore, null);
    }
docs: Load the provided key store in a safe manner.
  
  @param aKeyStoreType
  Type of key store. May not be <code>null</code>.
  @param sKeyStorePath
  Path to the key store. May not be <code>null</code> to succeed.
  @param sKeyStorePassword
  Password for the key store. May not be <code>null</code> to succeed.
  @return The key store loading result. Never <code>null</code>.