@safetech/pcsdk - v2.1.0
    Preparing search index...

    Class PCSDK

    PCSDK SDK main class

    Index

    Properties

    timeOffset: number = 0

    Methods

    • Returns the last plugin error code captured during initialization

      Returns number

    • Returns PCError

    • Returns information about all connected tokens

      Returns Promise<
          { deviceId: number; label: string; leftSpace: number; serial: string }[],
      >

    • Parameters

      • Optionalcallback: (status: { connected: number[]; disconnected: number[] }) => void

        The function is called when a token is connected or disconnected. An object with properties {connected, disconnected} is passed as arguments, which contains arrays with identifiers of disconnected and connected tokens.

      • OptionalerrorCallback: (error: PCError | undefined) => void

        The function is called when an error occurs during connection status polling.

      • Optionaloptions: { dev?: boolean; rutokenOnly?: boolean; unixTime?: number } = {}

        SDK initialization options.

        • Optionaldev?: boolean

          Enable verbose development logging.

        • OptionalrutokenOnly?: boolean

          Use Rutoken as the only key storage.

        • OptionalunixTime?: number

          Custom time source as a Unix timestamp in seconds. If omitted, time is synchronized via NTP (use.ntpjs.org). Pass 0 to use the local machine time. If an invalid value is provided, the SDK logs a warning and falls back to the local machine time without throwing an error.

      Returns
          | Promise<
              {
                  db: { error: PCError
                  | null; ok: boolean };
                  plugin: { error: PCError | null; ok: boolean };
              },
          >
          | undefined

    • Whether PCSDK is properly initialized

      Returns boolean

    • Checking the activity of the Rutoken

      Returns boolean

    • The scenario of using only the Rutoken plugin is enabled

      Returns boolean