@safetech/pcsdk - v2.4.1-build.465
    Preparing search index...

    Class PCUsersManager

    PCSDK Users Manager

    Index

    Constructors

    Methods

    • Activates the PCUser with provided activation code. Should be called immediately after PCUsersManager#importUser if PCUser#isActivated returns false.

      Parameters

      • user: PCUser

        Target PCUser object

      • activationCode: string

        Activation code

      Returns Promise<void>

    • Removes PCUser from the storage.

      Parameters

      • user: PCUser

        Target PCUser object

      • password: string | null

        Rutoken password

      Returns Promise<void>

    • Returns PCUser from storage by its id

      Parameters

      • userId: string

        ID of user

      Returns Promise<PCUser>

      PCUser object

    • Get user certificate information

      Parameters

      Returns Promise<
          {
              certificate?: string;
              certRequest?: string;
              status: CertificateStatus;
          },
      >

    • Create PCUserJSON by input source (Deep Link value, QR-code value) and deviceId

      Parameters

      • source: string | PCUserJSON

        User data

      • deviceId: number | null

        Device id

      Returns Promise<PCUser>

    • List of PCUser in the storage

      Returns Promise<PCUser[]>

      array of PCUser objects

    • Register PCUser on PCSDK Server

      Parameters

      • user: PCUser

        Target PCUser object

      • password: string | null | undefined

        User password. May be omitted when options.useBiometry is true, the user is a web ECDSA key and has ONLINE_CREDENTIALS

      • Optionaloptions: { overwrite?: boolean; pushAddress?: PushAddress; useBiometry?: boolean } = {}

        pushAddress — where the server sends notifications for this key (optional)

      Returns Promise<string>

    • Stores a new PCUser an existing object in storage.

      Parameters

      • user: PCUser

        Target PCUser object

      • keyName: string

        Key name

      • password: string | null | undefined

        User password. May be omitted if register was called with useBiometry

      Returns Promise<void>

    • Sets or changes where PC Server sends notifications for a registered PCUser. Use it when the push token changes, or to add notifications to a key registered without them.

      Parameters

      • user: PCUser

        Registered user

      • pushAddress: PushAddress

        New push address

      Returns Promise<void>

      await PCUsersManager.updatePushAddress(user, {
      deviceType: 'messenger_max',
      devicePushId: String(maxUserId),
      appId: 'org.paycontrol.max',
      });