Class AuditClient

java.lang.Object
cloud.pangeacyber.pangea.Client
cloud.pangeacyber.pangea.audit.AuditClient

public class AuditClient extends Client
  • Field Details

    • serviceName

      public static String serviceName
  • Constructor Details

    • AuditClient

      public AuditClient(Config config)
      Deprecated.
      use AuditClientBuilder instead.
    • AuditClient

      public AuditClient(Config config, String privateKeyFilename, Map<String,Object> pkInfo)
      Deprecated.
      use AuditClientBuilder instead.
    • AuditClient

      public AuditClient(Config config, String privateKeyFilename)
      Deprecated.
      use AuditClientBuilder instead.
    • AuditClient

      protected AuditClient(AuditClient.AuditClientBuilder builder)
  • Method Details

    • log

      Log an entry
      Parameters:
      event - event to log
      Returns:
      LogResponse
      Throws:
      PangeaException
      PangeaAPIException
      Description:
      Log an event to Audit Secure Log. By default does not sign event and verbose is left as server default
      Example:
      String msg = "Event's message"; Event event = new Event(msg); LogResponse response = client.log(event);
    • log

      public LogResponse log(Event event, SignMode signMode, boolean verbose, boolean verify) throws PangeaException, PangeaAPIException
      Log an entry - event, sign, verbose
      Parameters:
      event - event to log
      signMode - "Unsigned" or "Local"
      verbose - true to more verbose response
      Returns:
      LogResponse
      Throws:
      PangeaException
      PangeaAPIException
      Description:
      Log an event to Audit Secure Log. Can select sign event or not and verbosity of the response.
      Example:
      String msg = "Event's message"; Event event = new Event(msg); LogResponse response = client.log(event, "Local", true);
    • getRoot

      Get last root
      Returns:
      RootResponse
      Throws:
      PangeaException
      PangeaAPIException
      Description:
      Get last root from Pangea Server
      Example:
      RootResponse response = client.getRoot();
    • getRoot

      public RootResponse getRoot(int treeSize) throws PangeaException, PangeaAPIException
      Get root from Pangea Server
      Parameters:
      treeSize - tree size to get root
      Returns:
      RootResponse
      Throws:
      PangeaException
      PangeaAPIException
      Description:
      Get root from three of treeSize from Pangea Server
      Example:
      RootResponse response = client.getRoot(treeSize);
    • search

      Search
      Parameters:
      input - query filters to perform search
      Returns:
      SearchResponse
      Throws:
      PangeaException
      PangeaAPIException
      Description:
      Perform a search of logs according to input param. By default verify logs consistency and events hash and signature.
      Example:
      SearchInput input = new SearchInput("message:Integration test msg"); input.setMaxResults(10); SearchResponse response = client.search(input);
    • search

      public SearchResponse search(SearchInput input, boolean verifyConsistency, boolean verifyEvents) throws PangeaException, PangeaAPIException
      Search - input, verifyConsistency, verifyEvents
      Parameters:
      input - query filters to perform search
      verifyConsistency - true to verify logs consistency proofs
      verifyEvents - true to verify logs hash and signature
      Returns:
      SearchResponse
      Throws:
      PangeaException
      PangeaAPIException
      Description:
      Perform a search of logs according to input param. Allow to select to verify or nor consistency proof and events.
      Example:
      SearchInput input = new SearchInput("message:Integration test msg"); input.setMaxResults(10); SearchResponse response = client.search(input);
    • results

      public ResultsResponse results(String id, Integer limit, Integer offset) throws PangeaException, PangeaAPIException
      Results
      Parameters:
      id - A search results identifier returned by the search call. By default verify events and do not verify consistency.
      limit - Number of audit records to include in a single set of results.
      offset - Offset from the start of the result set to start returning results from.
      Returns:
      ResultsResponse
      Throws:
      PangeaException
      PangeaAPIException
      Description:
      Return result's page from search id.
    • results

      public ResultsResponse results(String id, Integer limit, Integer offset, boolean verifyConsistency, boolean verifyEvents) throws PangeaException, PangeaAPIException
      Results - id, limit, offset, verifyConsistency, verifyEvents
      Parameters:
      id - A search results identifier returned by the search call.
      limit - Number of audit records to include in a single set of results.
      offset - Offset from the start of the result set to start returning results from.
      verifyConsistency - true to verify logs consistency proofs
      verifyEvents - true to verify logs hash and signature
      Returns:
      ResultsResponse
      Throws:
      PangeaException
      PangeaAPIException
      Description:
      Return result's page from search id. Allow to select to verify or nor consistency proof and events.