Methods

This can be used after initializing the Wepin PIN Pad Library.

generateRegistrationPINBlock

wepinPin.generateRegistrationPINBlock()

To display the PIN pad screen to receive the PIN required for wallet creation and user registration, process the entered PIN to create a PIN Block.

Parameters

  • <void>

Return value

  • CompletableFuture <RegistrationPinBlock>

    • uvd <EncUVD>

      • b64Data <String> Data encrypted with the original key of b64SKey.

      • b64SKey <String> The key used to generate b64Data.

      • seqNum <Int> optional A value used to verify that PIN Blocks are used in sequential order.

    • hint <EncPinHint>

      • data <string> The encrypted value of the PIN hint.

      • length <string> The length of the PIN hint.

      • version <number>

      The version of the PIN hint.

Example

wepinPin.generateRegistrationPINBlock().whenComplete((res, err) -> {
    if (err == null) {
        RegistrationPinBlock registerPin = new RegistrationPinBlock(res.getUvd(), res.getHint());
        // You need to make a Wepin RESTful API request using the received data.
    } else {
        System.out.println(err);
    }
});

generateAuthPINBlock

wepinPin.generateAuthPINBlock(3)

To display the PIN pad screen to receive the PIN required for user authentication and process the entered PIN to create a PIN Block. If the user has enabled 2FA (OTP), display a screen to receive the OTP code and process it as well.

Parameters

  • count <Int> optional

    The number of PIN Blocks to be generated. The default value is 1.

Return value

  • Promise <AuthPinBlock>

    • uvdList List<EncUVD> A list of encrypted PIN Blocks.

      • <EncUVD>

        • b64Data <String> Data encrypted with the original key of b64SKey.

        • b64SKey <String> The key used to generate b64Data.

        • seqNum <Int> optional A value used to verify that PIN Blocks are used in sequential order. In a Multi Tx request, PIN Blocks must be used strictly in the received order (1, 2, 3...).

    • otp <String> optional The OTP code entered by the user if they have enabled 2FA (OTP).

Example

wepinPin.generateAuthPINBlock(3).whenComplete((res, err) -> {
    if (err == null) {
        AuthPinBlock authPin = new AuthPinBlock(res.getUvdList(), res.getOtp());
        // You need to make a Wepin RESTful API request using the received data.
    } else {
        System.out.println(err);
    }
});

generateChangePINBlock

wepinPin.generateChangePINBlock()

To display the PIN pad screen to receive the PIN required for the user to change their PIN and process the entered PIN to create a PIN Block. If the user has enabled 2FA (OTP), display a screen to receive the OTP code and process it as well.

Parameters

  • <void>

Return Value

  • CompletableFuture <ChangePinBlock>

    • uvd <EncUVD>

      • b64Data <String> Data encrypted with the original key of b64SKey.

      • b64SKey <String> The key used to generate b64Data.

      • seqNum <Int> optional A value used to verify that PIN Blocks are used in sequential order.

    • newUVD <EncUVD>

      • b64Data <String> Data encrypted with the original key of b64SKey.

      • b64SKey <String> The key used to generate b64Data.

      • seqNum <Int> optional A value used to verify that PIN Blocks are used in sequential order.

    • hint <EncPinHint>

      • data <string> The encrypted value of the PIN hint.

      • length <string> The length of the PIN hint.

      • version <number>

      The version of the PIN hint.

    • otp <String> optional The OTP code entered by the user if they have enabled 2FA (OTP).

Example

wepinPin.generateChangePINBlock().whenComplete((res, err) -> {
    if (err == null) {
        ChangePinBlock changePin = new ChangePinBlock(res.getUvd(), res.getNewUVD(), res.getHint(), res.getOtp());
        // You need to make a Wepin RESTful API request using the received data.
    } else {
        System.out.println(err);
    }
});

generateAuthOTP

wepinPin.generateAuthOTPCode()

Display a screen to receive the OTP code from the user and process it.

Parameters

  • <void>

Return Value

  • CompletableFuture <AuthOTP>

    • code <String> The entered OTP code.

Example

wepinPin.generateAuthOTPCode().whenComplete((res, err) -> {
    if (err == null) {
        AuthOTP authOTPCode = new AuthOTP(res.getCode());
        // You need to make a Wepin RESTful API request using the received data.
    } else {
        System.out.println(err);
    }
});

finalize

wepinPin.finalize()

It terminates the use of the Wepin PIN Pad Library.

Parameters

  • <void>

Return Value

  • <void>

Example

wepinPin.finalize();

Last updated