code: private void validateParameters(String filePath, String password, int validity, String subjectDN, int keySize, String sigAlg) {
          if (!validateFilePath(filePath)) {
              throw new IllegalArgumentException("filePath must be a valid filePath within the file system.");
          }
          if (password == null || password.length() < MINIMUM_PASSWORD_LENGTH) {
              throw new IllegalArgumentException("The password must be at least " +
                                                 MINIMUM_PASSWORD_LENGTH +
                                                 " characters in length.");
          }
          if (validity < MINIMUM_VALIDITY) {
              throw new IllegalArgumentException("The validity period must be at least " +
                                                 MINIMUM_VALIDITY + " days.");
          }
  
          List<String> validSigAlg = VALID_SIG_ALG;
          if (!validSigAlg.contains(sigAlg)) {
              throw new IllegalArgumentException("The signagure algorithm values include " + VALID_SIG_ALG);
          }
  
          String type = getKeyFromSigAlg(sigAlg);
          if (type.equals(KEYALG_RSA_TYPE)) {
              List<Integer> validKeySizes = VALID_RSA_KEYSIZE;
              if (!validKeySizes.contains(keySize)) {
                  throw new IllegalArgumentException("The key sizes for an RSA key include " + VALID_RSA_KEYSIZE);
              }
          } else {
              List<Integer> validKeySizes = VALID_EC_KEYSIZE;
              if (!validKeySizes.contains(keySize)) {
                  throw new IllegalArgumentException("The key sizes for an EC key include " + VALID_EC_KEYSIZE);
              }
          }
  
          validateSubjectDN(subjectDN);
      }
docs: Validate the parameters.
  
  @param filePath
  @param password
  @param validity
  @param subjectDN