Package ch.admin.suis.client.core.service

# Interface IValidationServiceClient

All Known Implementing Classes:
  `ValidationServiceClient`

public interface IValidationServiceClient
The main interface to the validation service. Use `ValidationServiceClientBuilder` to get an implementation object providing the interface.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Mandator[]`
  `getAllMandators(Locale locale)`
  `List<ValidationResponse>`
  `validateMultipleRequests(UserRequest request, boolean pdfReport)`
  Same as `validateMultipleRequests(UserRequest, boolean, boolean)` with the `doLogs` parameter set to `false`.
  `List<ValidationResponse>`
  `validateMultipleRequests(UserRequest request, boolean pdfReport, boolean doLogs)`
  Validates a list of signature entries, each in its own request to the validation service.
  `ValidationResponse`
  `validateOneRequest(List<FileRequest> filesToValidate, boolean pdfReport, String userOrganization, String userName, String language, String pdfReportName)`
  Same as `validateOneRequest(List, boolean, String, String, String, String, boolean, boolean)` with the `doLogs` and `processUnsignedFiles` parameters set to `false`.
  `ValidationResponse`
  `validateOneRequest(List<FileRequest> filesToValidate, boolean pdfReport, String userOrganization, String userName, String language, String pdfReportName, boolean doLogs)`
  Same as `validateOneRequest(List, boolean, String, String, String, String, boolean, boolean)` with the `processUnsignedFiles` parameter set to `false`.
  `ValidationResponse`
  `validateOneRequest(List<FileRequest> filesToValidate, boolean pdfReport, String userOrganization, String userName, String language, String pdfReportName, boolean doLogs, boolean processUnsignedFiles)`
  Validates a list of files in a single request to the validation service.
  `ValidationResponse`
  `validateOneRequestS(List<StreamRequest> filesToValidate, boolean pdfReport, String userOrganization, String userName, String language, String pdfReportName)`
  Same as `validateOneRequest(List, boolean, String, String, String, String, boolean, boolean)` with the `doLogs` and `processUnsignedFiles` parameters set to `false`.
  `ValidationResponse`
  `validateOneRequestS(List<StreamRequest> filesToValidate, boolean pdfReport, String userOrganization, String userName, String language, String pdfReportName, boolean doLogs)`
  Same as `validateOneRequest(List, boolean, String, String, String, String, boolean, boolean)` with the `processUnsignedFiles` parameter set to `false`.
  `ValidationResponse`
  `validateOneRequestS(List<StreamRequest> filesToValidate, boolean pdfReport, String userOrganization, String userName, String language, String pdfReportName, boolean doLogs, boolean processUnsignedFiles)`
  Validates a list of input streams in a single request to the validation service.
  `ValidationResponse`
  `validateOneSignature(byte[] fileToValidate, String client, boolean pdfReport, String sigName, String docName, String userOrganization, String userName, String language, String pdfReportName)`
  Same as `validateOneSignature(byte[], String, boolean, String, String, String, String, String, String, boolean)` with the `doLogs` parameter set to `false`.
  `ValidationResponse`
  `validateOneSignature(byte[] fileToValidate, String client, boolean pdfReport, String sigName, String docName, String userOrganization, String userName, String language, String pdfReportName, boolean doLogs)`
  Validates a single signature entry in a file.
  `ValidationResponse`
  `validatePkcs7(org.bouncycastle.cms.CMSSignedData pkcs7, byte[] plainHash, String client)`
  `ValidationResponse`
  `validatePkcs7(org.bouncycastle.cms.CMSSignedData pkcs7, byte[] plainHash, String client, boolean doLogs)`

- ## Method Details

  - ### getAllMandators

    Mandator[] getAllMandators(Locale locale)

  - ### validateMultipleRequests

    List<ValidationResponse> validateMultipleRequests(UserRequest request, boolean pdfReport) throws NoSuchAlgorithmException, IOException
    Same as `validateMultipleRequests(UserRequest, boolean, boolean)` with the `doLogs` parameter set to `false`.
    Parameters:
      `request` - the `UserRequest` data structure containing the signature entries to validate
      `pdfReport` - a flag specifying whether the validation service should generate and return a report in PDF format
    Returns:
      a list of `ValidationResponse` data structures, one for each signature entry given
    Throws:
      `NoSuchAlgorithmException` - if the SHA-256 hash algorithm is not available
      `IOException` - if the file given in the `request` parameter cannot be read

  - ### validateMultipleRequests

    List<ValidationResponse> validateMultipleRequests(UserRequest request, boolean pdfReport, boolean doLogs) throws NoSuchAlgorithmException, IOException
    Validates a list of signature entries, each in its own request to the validation service. The signature entries to validate are contained in the given `UserRequest` data structure.
    Parameters:
      `request` - the UserRequest data structure containing the signature entries to validate
      `pdfReport` - a flag specifying whether the validation service should generate and return a report in PDF format
      `doLogs` - a flag specifying whether the call should write details about the service input and results to the log
    Returns:
      a list of `ValidationResponse` data structures, one for each signature entry given
    Throws:
      `NoSuchAlgorithmException` - if the SHA-256 hash algorithm is not available
      `IOException` - if the file given in the `request` parameter cannot be read

  - ### validateOneRequest

    ValidationResponse validateOneRequest(List<FileRequest> filesToValidate, boolean pdfReport, String userOrganization, String userName, String language, String pdfReportName) throws NoSuchAlgorithmException, IOException, IllegalArgumentException
    Same as `validateOneRequest(List, boolean, String, String, String, String, boolean, boolean)` with the `doLogs` and `processUnsignedFiles` parameters set to `false`.
    Parameters:
      `filesToValidate` - the list of files to validate
      `pdfReport` - a flag specifying whether the validation service should generate and return a report in PDF format
      `userOrganization` - the `userOrganization` property to pass to the validation service
      `userName` - the `userOrganization` property to pass to the validation service
      `language` - the `language` property to pass to the validation service
      `pdfReportName` - the `pdfReportName` property that should be echoed by the validation service
    Returns:
      the `ValidationResponse` data structure created by the validation service
    Throws:
      `NoSuchAlgorithmException` - if the SHA-256 hash algorithm is not available
      `IOException` - if one of the files given in the `filesToValidate` parameter cannot be read
      `IllegalArgumentException` - if none of the files given in the `filesToValidate` parameter contains a signature

  - ### validateOneRequest

    ValidationResponse validateOneRequest(List<FileRequest> filesToValidate, boolean pdfReport, String userOrganization, String userName, String language, String pdfReportName, boolean doLogs) throws NoSuchAlgorithmException, IOException, IllegalArgumentException
    Same as `validateOneRequest(List, boolean, String, String, String, String, boolean, boolean)` with the `processUnsignedFiles` parameter set to `false`.
    Parameters:
      `filesToValidate` - the list of files to validate
      `pdfReport` - a flag specifying whether the validation service should generate and return a report in PDF format
      `userOrganization` - the `userOrganization` property to pass to the validation service
      `userName` - the `userOrganization` property to pass to the validation service
      `language` - the `language` property to pass to the validation service
      `pdfReportName` - the `pdfReportName` property that should be echoed by the validation service
      `doLogs` - a flag specifying whether the call should write details about the service input and results to the log
    Returns:
      the `ValidationResponse` data structure created by the validation service
    Throws:
      `NoSuchAlgorithmException` - if the SHA-256 hash algorithm is not available
      `IOException` - if one of the files given in the `filesToValidate` parameter cannot be read
      `IllegalArgumentException` - if none of the files given in the `filesToValidate` parameter contains a signature

  - ### validateOneRequest

    ValidationResponse validateOneRequest(List<FileRequest> filesToValidate, boolean pdfReport, String userOrganization, String userName, String language, String pdfReportName, boolean doLogs, boolean processUnsignedFiles) throws NoSuchAlgorithmException, IOException, IllegalArgumentException
    Validates a list of files in a single request to the validation service.
    Parameters:
      `filesToValidate` - the list of files to validate
      `pdfReport` - a flag specifying whether the validation service should generate and return a report in PDF format
      `userOrganization` - the `userOrganization` property to pass to the validation service
      `userName` - the `userOrganization` property to pass to the validation service
      `language` - the `language` property to pass to the validation service
      `pdfReportName` - the `pdfReportName` property that should be echoed by the validation service
      `doLogs` - a flag specifying whether the call should write details about the service input and results to the log
      `processUnsignedFiles` - a flag specifying whether files not containing a signature should be processed by the validation service
    Returns:
      the `ValidationResponse` data structure created by the validation service
    Throws:
      `NoSuchAlgorithmException` - if the SHA-256 hash algorithm is not available
      `IOException` - if one of the files given in the `filesToValidate` parameter cannot be read
      `IllegalArgumentException` - if the `processUnsignedFiles` parameter is `false` none of the files given in the `filesToValidate` parameter contains a signature

  - ### validateOneRequestS

    ValidationResponse validateOneRequestS(List<StreamRequest> filesToValidate, boolean pdfReport, String userOrganization, String userName, String language, String pdfReportName) throws NoSuchAlgorithmException, FileNotFoundException, IOException, IllegalArgumentException
    Same as `validateOneRequest(List, boolean, String, String, String, String, boolean, boolean)` with the `doLogs` and `processUnsignedFiles` parameters set to `false`.
    Parameters:
      `filesToValidate` - the list of input streams to validate
      `pdfReport` - a flag specifying whether the validation service should generate and return a report in PDF format
      `userOrganization` - the `userOrganization` property to pass to the validation service
      `userName` - the `userOrganization` property to pass to the validation service
      `language` - the `language` property to pass to the validation service
      `pdfReportName` - the `pdfReportName` property that should be echoed by the validation service
    Returns:
      the `ValidationResponse` data structure created by the validation service
    Throws:
      `NoSuchAlgorithmException` - if the SHA-256 hash algorithm is not available
      `IOException` - if one of the input streams given in the `filesToValidate` parameter cannot be read
      `IllegalArgumentException` - if none of the input streams given in the `filesToValidate` parameter contains a signature
      `FileNotFoundException`

  - ### validateOneRequestS

    ValidationResponse validateOneRequestS(List<StreamRequest> filesToValidate, boolean pdfReport, String userOrganization, String userName, String language, String pdfReportName, boolean doLogs) throws NoSuchAlgorithmException, FileNotFoundException, IOException, IllegalArgumentException
    Same as `validateOneRequest(List, boolean, String, String, String, String, boolean, boolean)` with the `processUnsignedFiles` parameter set to `false`.
    Parameters:
      `filesToValidate` - the list of input streams to validate
      `pdfReport` - a flag specifying whether the validation service should generate and return a report in PDF format
      `userOrganization` - the `userOrganization` property to pass to the validation service
      `userName` - the `userOrganization` property to pass to the validation service
      `language` - the `language` property to pass to the validation service
      `pdfReportName` - the `pdfReportName` property that should be echoed by the validation service
      `doLogs` - a flag specifying whether the call should write details about the service input and results to the log
    Returns:
      the `ValidationResponse` data structure created by the validation service
    Throws:
      `NoSuchAlgorithmException` - if the SHA-256 hash algorithm is not available
      `IOException` - if one of the input streams given in the `filesToValidate` parameter cannot be read
      `IllegalArgumentException` - if none of the input streams given in the `filesToValidate` parameter contains a signature
      `FileNotFoundException`

  - ### validateOneRequestS

    ValidationResponse validateOneRequestS(List<StreamRequest> filesToValidate, boolean pdfReport, String userOrganization, String userName, String language, String pdfReportName, boolean doLogs, boolean processUnsignedFiles) throws NoSuchAlgorithmException, FileNotFoundException, IOException, IllegalArgumentException
    Validates a list of input streams in a single request to the validation service.
    Parameters:
      `filesToValidate` - the list of input streams to validate
      `pdfReport` - a flag specifying whether the validation service should generate and return a report in PDF format
      `userOrganization` - the `userOrganization` property to pass to the validation service
      `userName` - the `userOrganization` property to pass to the validation service
      `language` - the `language` property to pass to the validation service
      `pdfReportName` - the `pdfReportName` property that should be echoed by the validation service
      `doLogs` - a flag specifying whether the call should write details about the service input and results to the log
      `processUnsignedFiles` - a flag specifying whether files not containing a signature should be processed by the validation service
    Returns:
      the `ValidationResponse` data structure created by the validation service
    Throws:
      `NoSuchAlgorithmException` - if the SHA-256 hash algorithm is not available
      `IOException` - if one of the input streams given in the `filesToValidate` parameter cannot be read
      `IllegalArgumentException` - if the `processUnsignedFiles` parameter is `false` none of the input streams given in the `filesToValidate` parameter contains a signature
      `FileNotFoundException`

  - ### validateOneSignature

    ValidationResponse validateOneSignature(byte[] fileToValidate, String client, boolean pdfReport, String sigName, String docName, String userOrganization, String userName, String language, String pdfReportName) throws NoSuchAlgorithmException, IOException
    Same as `validateOneSignature(byte[], String, boolean, String, String, String, String, String, String, boolean)` with the `doLogs` parameter set to `false`.
    Parameters:
      `fileToValidate` - the data containing the signature to validate
      `client` - the `client` property to pass to the validation service
      `pdfReport` - a flag specifying whether the validation service should generate and return a report in PDF format
      `sigName` - the name of the signature to extract from the given file and validate
      `docName` - the name of the given file
      `userOrganization` - the `userOrganization` property to pass to the validation service
      `userName` - the `userOrganization` property to pass to the validation service
      `language` - the `language` property to pass to the validation service
      `pdfReportName` - the `pdfReportName` property that should be echoed by the validation service
    Returns:
      the `ValidationResponse` data structure created by the validation service
    Throws:
      `NoSuchAlgorithmException` - if the SHA-256 hash algorithm is not available
      `IOException`

  - ### validateOneSignature

    ValidationResponse validateOneSignature(byte[] fileToValidate, String client, boolean pdfReport, String sigName, String docName, String userOrganization, String userName, String language, String pdfReportName, boolean doLogs) throws NoSuchAlgorithmException, IOException
    Validates a single signature entry in a file.
    Parameters:
      `fileToValidate` - the data containing the signature to validate
      `client` - the `client` property to pass to the validation service
      `pdfReport` - a flag specifying whether the validation service should generate and return a report in PDF format
      `sigName` - the name of the signature to extract from the given file and validate
      `docName` - the name of the given file
      `userOrganization` - the `userOrganization` property to pass to the validation service
      `userName` - the `userOrganization` property to pass to the validation service
      `language` - the `language` property to pass to the validation service
      `pdfReportName` - the `pdfReportName` property that should be echoed by the validation service
      `doLogs` - a flag specifying whether the call should write details about the service input and results to the log
    Returns:
      the `ValidationResponse` data structure created by the validation service
    Throws:
      `NoSuchAlgorithmException` - if the SHA-256 hash algorithm is not available
      `IOException`

  - ### validatePkcs7

    ValidationResponse validatePkcs7(org.bouncycastle.cms.CMSSignedData pkcs7, byte[] plainHash, String client) throws IOException
    Throws:
      `IOException`

  - ### validatePkcs7

    ValidationResponse validatePkcs7(org.bouncycastle.cms.CMSSignedData pkcs7, byte[] plainHash, String client, boolean doLogs) throws IOException
    Throws:
      `IOException`