Foxit PDF SDK

Public Member Functions | Static Public Member Functions | List of all members
com.foxit.sdk.pdf.TimeStampServerMgr Class Reference

## Public Member Functions
synchronized void | delete ()
| Clean up related C++ resources immediately. More...

## Static Public Member Functions
static TimeStampServer | addServer (String server_name, String server_url, String user_name, String password) throws com.foxit.sdk.PDFException
| Add a time stamp server to the manager. More...
static TimeStampServer | getDefaultServer () throws com.foxit.sdk.PDFException
| Get default time stamp server object. More...
static TimeStampServer | getServer (int index) throws com.foxit.sdk.PDFException
| Get time stamp server with specified index. More...
static int | getServerCount () throws com.foxit.sdk.PDFException
| Get time stamp server count. More...
static int | getServerIndex (TimeStampServer server) throws com.foxit.sdk.PDFException
| Get the index of a speicified time stamp server object. More...
static int | initialize ()
| Initialize time stamp server manager. More...
static void | release ()
| Release time stamp server manager. More...
static void | removeServer (int index) throws com.foxit.sdk.PDFException
| Remove a time stamp server from the manager, by index. More...
static void | removeServer (TimeStampServer server) throws com.foxit.sdk.PDFException
| Remove a time stamp server from the manager, by index. More...
static void | setDefaultServer (int index) throws com.foxit.sdk.PDFException
| Set default time stamp server object by index. More...
static void | setDefaultServer (TimeStampServer server) throws com.foxit.sdk.PDFException
| Set default time stamp server object by index. More...

## Detailed Description

Time stamp server manager is used to manage some time stamp servers. The default time stamp server in this manager will be used in default signature callback for filter "Adobe.PPKLite" with sub filter "ETSI.CAdES.detached" and filter "Adobe.PPKLite" with sub filter "ETSI.RFC3161". So before signing or verifying signatures in these filter-subfitler pair by using default signature callback in Foxit PDF SDK, please ensure that a valid com.foxit.sdk.pdf.TimeStampCallback object has been set through Library.setTimeStampCallback or the time stamp server manager has been initialized and the default server is set, if both are set, Foxit PDF SDK will use the com.foxit.sdk.pdf.TimeStampCallback .

## Member Function Documentation

## ◆ addServer()

static TimeStampServer com.foxit.sdk.pdf.TimeStampServerMgr.addServer | ( | String | server_name,
|  | String | server_url,
|  | String | user_name,
|  | String | password
| ) |  | throws com.foxit.sdk.PDFException
| static

Add a time stamp server to the manager.

Parameters

  [in] | server_name | Name of time stamp server. It should not be an empty string.
  [in] | server_url | URL of time stamp server. It should not be an empty string.
  [in] | user_name | User name for the time stamp server. If no need, please pass an empty string.
  [in] | password | Password for the time stamp server. If no need, please pass an empty string.

Returns
  The newly added time stamp server object.

## ◆ delete()

synchronized void com.foxit.sdk.pdf.TimeStampServerMgr.delete | ( |  | ) |

Clean up related C++ resources immediately.

Returns
  None.

Note
  Once this function is called, current object cannot be used anymore.

## ◆ getDefaultServer()

static TimeStampServer com.foxit.sdk.pdf.TimeStampServerMgr.getDefaultServer | ( |  | ) | throws com.foxit.sdk.PDFException
| static

Get default time stamp server object.

Returns
  A time stamp server object which is the default one.

## ◆ getServer()

static TimeStampServer com.foxit.sdk.pdf.TimeStampServerMgr.getServer | ( | int | index | ) | throws com.foxit.sdk.PDFException
| static

Get time stamp server with specified index.

Parameters

  [in] | index | Time stamp server index. Valid range: from 0 to (count-1). count is returned by function TimeStampServerMgr.getServerCount .

Returns
  A time stamp server object.

## ◆ getServerCount()

static int com.foxit.sdk.pdf.TimeStampServerMgr.getServerCount | ( |  | ) | throws com.foxit.sdk.PDFException
| static

Get time stamp server count.

Returns
  Server count.

## ◆ getServerIndex()

static int com.foxit.sdk.pdf.TimeStampServerMgr.getServerIndex | ( | TimeStampServer | server | ) | throws com.foxit.sdk.PDFException
| static

Get the index of a speicified time stamp server object.

Parameters

  [in] | server | A time stamp server object.

Returns
  Index of specified time stamp server object.

## ◆ initialize()

static int com.foxit.sdk.pdf.TimeStampServerMgr.initialize | ( |  | ) |
| static

Initialize time stamp server manager.

This function should be called first before any other functions in TimeStampServerMgr can be called.

Returns
  com.foxit.sdk.common.Constants.e_ErrSuccess means success.
  For more information about error code values, please refer to values starting from com.foxit.sdk.common.Constants.e_ErrSuccess .

## ◆ release()

static void com.foxit.sdk.pdf.TimeStampServerMgr.release | ( |  | ) |
| static

Release time stamp server manager.

User can call this function to release time stamp server manager when no need to use it any more. After this function is called, if user wants to use time stamp server manager again, please call function TimeStampServerMgr.initialize again.

Returns
  None.

## ◆ removeServer() [1/2]

static void com.foxit.sdk.pdf.TimeStampServerMgr.removeServer | ( | int | index | ) | throws com.foxit.sdk.PDFException
| static

Remove a time stamp server from the manager, by index.

Parameters

  [in] | index | Index of the time stamp server which is to be removed from the manager.

Returns
  None.

## ◆ removeServer() [2/2]

static void com.foxit.sdk.pdf.TimeStampServerMgr.removeServer | ( | TimeStampServer | server | ) | throws com.foxit.sdk.PDFException
| static

Remove a time stamp server from the manager, by index.

Parameters

  [in] | server | A time stamp server object to be removed from the manager. If input server object is invalid, this function will do nothing and return directly.

Returns
  None.

## ◆ setDefaultServer() [1/2]

static void com.foxit.sdk.pdf.TimeStampServerMgr.setDefaultServer | ( | int | index | ) | throws com.foxit.sdk.PDFException
| static

Set default time stamp server object by index.

Parameters

  [in] | index | Index of a time stamp server to be set as default one.Valid range: from 0 to (count-1). count is returned by function TimeStampServerMgr.getServerCount .

Returns
  None.

## ◆ setDefaultServer() [2/2]

static void com.foxit.sdk.pdf.TimeStampServerMgr.setDefaultServer | ( | TimeStampServer | server | ) | throws com.foxit.sdk.PDFException
| static

Set default time stamp server object by index.

Parameters

  [in] | server | A time stamp server object to be set as default server. If input server object is invalid, this function wil throw exception com.foxit.sdk.common.Constants.e_ErrNotFound .

Returns
  None.