This is a reference documentation of the inWebo mAccess library in Java. It lists error codes and methods integrated in the library.

Download inWebo mAccess library

The last version of inWebo mAccess library is available on the Resources Downloads page.

Go over the implementation guide to know how to integrate the inWebo SDK to your Android application.

Error codes

Code

Value

Description

ERR_OK

0

no error

ERR_NETWORK

1

network or server unreachable

ERR_CODE

2

The Activation code is incorrect

ERR_SN

3

one argument does not have the right syntax

ERR_ACCESS

4

access refused

ERR_VERSION

5

version error

ERR_BLOCKED

7

account is blocked

ERR_STATE

8

internal state not correct

ERR_NODEVICE

9

device is disabled or unknown

ERR_NOCA

10

User must activate inWebo helium or inWebo Desktop Token before achieving this operation

ERR_NOSRV

11

No service is available

ERR_PINREUSED

12

the new password equals the previous one

ERR_SYNCHROFAILED

13

the operation succeeded but it required a post-synchronization which failed

ERR_FORBIDDEN

14

forbidden operation (due to activated state/blocked state/upgradable state)

ERR_PINREFUSED

15

the password is refused (bad format)

ERR_TIMEOUT

16

timeout expired between xxxStart and xxxFinalize

ERR_BIOKEY

26

device is locked due to biokey errors

DESYNCHRONIZED

27

device desynchronized

ERR_OTHER

999

any other error

Pin Mode codes

Code

Value

Description

PINMODE_NONE

0

no pin is required (leave “”)

PINMODE_CURRENT

1

current pin is required

PINMODE_NEW

2

a new pin is required

PINMODE_BIO

8

a biokey is required

PINMODE_CURRENT | PINMODE_BIO

9

a pin OR biokey is required

Methods

The methods below are included in the class IW of the package com.inwebo.iwlib, in the inWebo mAccess library.

Activation

ActivationStart

public long ActivationStart(String code)
CODE

Method description: starts the device activation process.

Parameters:

  • code (string) → activation code

Returns: an error code:

  • ERR_OK: no error

  • ERR_NETWORK: network error

  • ERR_FORBIDDEN: device is already activated

  • ERR_SN: syntax error for “code”

  • ERR_VERSION: version error, user must upgrade the device

ActivationFinalize

public long ActivationFinalize(String code, String pin, String name)
CODE

Method description: finalizes the device activation process

Parameters:

  • code (string) → activation code

  • pin (string) → the user’s pin code

  • name (string) → the name of the device that is about to be activated

Returns: an error code

  • ERR_OK: no error

  • ERR_NETWORK: network error

  • ERR_FORBIDDEN: device is already activated

  • ERR_SYNCHROFAILED: the device is activated but not synchronized. Should propose to resynchronize.

  • ERR_PINREFUSED: syntax error for “pin”

  • ERR_CODE: bad code.

  • ERR_SN: syntax error for “code”

  • ERR_TIMEOUT: timeout since ActivationStart

Unlock - Reset PIN

ResetStart

public long ResetStart(String code) 
CODE

Method description: starts the reset pin process

Parameters:

  • code (string)→ unlock code

Returns: an error code

  • ERR_OK: no error

  • ERR_NETWORK: network error

  • ERR_FORBIDDEN: device is not activated or not blocked or to be upgraded

  • ERR_CODE: bad code.

  • ERR_SN: syntax error for “code”

  • ERR_NODEVICE: the device is unknown or has been permanently disabled

  • ERR_VERSION: version error, user must upgrade the device (see IWNewVersionAvailable)

ResetFinalize

 public long ResetFinalize(String code, String pin)
CODE

Method description: finalizes the reset pin process

Parameters:

  • code (string) → unlock code

  • pin (string) → the user’s pin code

Returns: an error code

  • ERR_OK: no error

  • ERR_NETWORK: network error

  • ERR_FORBIDDEN: device is not activated or blocked or to be upgraded

  • ERR_ACCESS: wrong password.

  • ERR_SYNCHROFAILED: the last step of the synchronization failed. Should propose to resynchronize.

  • ERR_SN: syntax error for “code”

  • ERR_PINREFUSED: syntax error for “password”

  • ERR_NODEVICE: the device is unknown or has been permanently disabled

  • ERR_TIMEOUT: timeout since IWResetStart

Synchronization

SynchronizeStart

public long SynchronizeStart()
CODE

Method description: starts the synchronization process to synchronize information between the application and InWebo server.

Returns: an error code

SynchronizeFinalize

public long SynchronizeFinalize(String pin)
CODE

Method description: finalizes the synchronization process to synchronize information between the application and InWebo server.

Parameters:

  • pin (string) → the user’s pin code

Returns: an error code

PIN update

PwdUpdateStart

public long PwdUpdateStart()
CODE

Method description: starts the pin update process

Returns: an error code

  • ERR_OK: no error

  • ERR_NETWORK: network error

  • ERR_FORBIDDEN: device is not activated or not blocked or to be upgraded

  • ERR_NODEVICE: the device is unknown or has been permanently disabled

  • ERR_VERSION: version error, user must upgrade the device (see NewVersionAvailable)

PwdUpdateFinalize

public long PwdUpdateFinalize(String newpin, String pin)
CODE

Method description: finalizes the pin update process

Parameters:

  • newpin (string) → the user’s new pin code

  • pin (string) → the user’s current pin code that is about to be replaced by newpin

Returns: an error code

  • ERR_OK: no error

  • ERR_NETWORK: network error

  • ERR_FORBIDDEN: device is not activated or blocked or to be upgraded

  • ERR_ACCESS: wrong password.

  • ERR_SYNCHROFAILED: the last step of the synchronization failed. Should propose to resynchronize.

  • ERR_PINREFUSED: syntax error for “password”

  • ERR_PINREUSED: new password equals previous password

  • ERR_NODEVICE: the device is unknown or has been permanently disabled

  • ERR_TIMEOUT: timeout since IWPwdUpdateStart

Reset all Biometric keys

UnsetBiokeysStart

public long UnsetBiokeysStart()
CODE

Method description: starts the process of resetting all biometric keys.

Returns: an error code

  • ERR_OK: no error

  • ERR_NETWORK: network error

  • ERR_FORBIDDEN: device is not activated or not blocked or to be upgraded

  • ERR_NODEVICE: the device is unknown or has been permanently disabled

  • ERR_VERSION: version error, user must upgrade the device (see IWNewVersionAvailable above)

A call to IWPinMode () will indicate which kind of password is required (current or none)

UnsetBiokeysFinalize

public long UnsetBiokeysFinalize(String pin)
CODE

Method description: finalize the process of resetting all biometric keys.

Parameters:

  • pin (string) → the user’s pin code

Returns: an error code

  • ERR_OK: no error

  • ERR_NETWORK: network error

  • ERR_FORBIDDEN: device is not activated or blocked or to be upgraded

  • ERR_ACCESS: wrong password.

  • ERR_NODEVICE: the device is unknown or has been permanently disabled

  • ERR_TIMEOUT: timeout since UnsetBiokeysStart

Register Biometric key

SetBiokeyStart

public long SetBiokeyStart()
CODE

Method description: starts the biometrics registration process

Returns: an error code

  • ERR_OK: no error

  • ERR_NETWORK: network error

  • ERR_FORBIDDEN: device is not activated or not blocked or to be upgraded

  • ERR_NODEVICE: the device is unknown or has been permanently disabled

  • ERR_VERSION: version error, user must upgrade the device (see IWNewVersionAvailable)

SetBiokeyFinalize

public long SetBiokeyFinalize(String biokey, String pin)
CODE

Method description: finalizes the biometrics registration process

Parameters:

  • biokey(string) → description

  • pin(string) → the user’s pin code

Returns: an error code

  • ERR_OK: no error

  • ERR_NETWORK: network error

  • ERR_FORBIDDEN: device is not activated or blocked or to be upgraded

  • ERR_ACCESS: wrong password.

  • ERR_NODEVICE: the device is unknown or has been permanently disabled

  • ERR_TIMEOUT: timeout since IWPwdUpdateStart

Online OTP

OnlineOtpStart

public long OnlineOtpStart(int i)
CODE

Method description: starts the “online OTP generation” process

Parameters:

  • i (int) → the service index in the table of available services. For a standard configuration with one service, the service index is 0.

Returns: an error code

  • ERR_OK: no error

  • ERR_NETWORK: network error

  • ERR_FORBIDDEN: device is not activated or blocked or to be upgraded

  • ERR_NODEVICE: the device is unknown or has been permanently disabled

  • ERR_VERSION: version error, user must upgrade the device (see IWNewVersionAvailable above)

OnlineOtpFinalize

public long OnlineOtpFinalize(int i, String pin)
CODE

Method description: finalizes the “online OTP generation” process

Parameters:

  • i(int) → the service index in the table of available services. For a standard configuration with one service, the service index is 0.

  • pin (string) → the user’s pin code

Returns: OnlineOtpFinalizeExt(i, pin, 0)

OtpAnswerOtp

public String OtpAnswerOtp()
CODE

Method description: retrieves a generated OTP after a process of online OTP generation (only if the OnlineOtpFinalize or OnlineOtpFinalizeExt call returns a response code “0”).

Returns: an OTP

OnlineOtpFinalizeExt

public long OnlineOtpFinalizeExt(int i, String pin, long keyType)
CODE

Method description: finalizes the “online OTP generation” process with biometric keys

Parameters:

  • i (int) → the service index in the table of available services. For a standard configuration with one service, the service index is 0.

  • pin (string) → the user’s pin code

  • keytype (long) → the keytype ( 0= pincode , 1= biometric key)

Returns: an error code

  • ERR_OK: no error

  • ERR_NETWORK: network error

  • ERR_FORBIDDEN: device is not activated or blocked or to be upgraded

  • ERR_ACCESS: wrong password.

  • ERR_SYNCHROFAILED: the last step of the synchronization failed. Should propose to resynchronize.

  • ERR_NODEVICE: the device is unknown or has been permanently disabled

  • ERR_TIMEOUT: timeout since IWOnlineOtpStart

Offline OTP

otpShouldSynchronize

public long OtpShouldSynchronize(int serviceid)
CODE

Method description: checks if a synchronization process is required, before starting the process of Offline OTP generation

Parameters:

  • serviceid (int) → the inWebo service identifier

Returns: an error code

  • 0 : no synchronization required

  • 1 : synchronization required

OtpModeQuery

public long OtpModeQuery(int serviceid)
CODE

Method description: indicates whether the pin should be requested, after a otpShouldSynchronize call and before starting the process of Offline OTP generation.

Parameters:

  • serviceid (int) → the inWebo service identifier

Returns: an error code

  • 0 → No PIN required

  • 1 → the Pin is required

OtpGenerate

public String OtpGenerate(String pin)
CODE

Method description: retrieves a generated OTP after a process of offline OTP generation (only if the OnlineOtpFinalize or OnlineOtpFinalizeExt call returns a response code “0”).

Parameters:

  • pin (string) → the user’s pin code

Returns: an OTP

DisplayTime

public long DisplayTime()
CODE

Method description: displays the remaining time before the OTP expiration (in seconds)

Returns: Otp.displayTime()

Push Notifications

SetDeviceOS

public void SetDeviceOS(String deviceOS)
CODE

Method description: defines the device operating system.

Parameters:

  • deviceOS (string) → the device’s OS (the default value is android)

To use Firebase notification service you must change the device OS to "firebase" using SetDeviceOS("firebase").

PushRegistrationStart

public long PushRegistrationStart()
CODE

Method description: starts the push registration process to allow inWebo to send push notifications to your application.

Returns: an error code

  • ERR_OK: no error

  • ERR_NETWORK: network error

  • ERR_FORBIDDEN: device is not activated or blocked or to be upgraded

  • ERR_NODEVICE: the device is unknown or has been permanently disabled

PushRegistrationFinalize

public long PushRegistrationFinalize(String push_id)
CODE

Method description: finalizes the push registration process to allow inWebo to send push notifications to your application.

Parameters:

  • push_id (string) → the push id of the device used for notification push service

Returns: an error code

  • ERR_OK: no error

  • ERR_NETWORK: network error

  • ERR_FORBIDDEN: device is not activated or blocked or to be upgraded

  • ERR_NODEVICE: the device is unknown or has been permanently disabled

  • ERR_TIMEOUT: timeout since IWPushRegistrationStart

CheckPush

public long CheckPush()
CODE

Method description: Checks if a push notification is available on inWebo server for the active instance of mAccess, and retrieves it. Typically this function can be called when starting the application.

Returns: an error code

  • 0 → a push is available

  • 999 → no pending push available or mobile push service may not be activated

PushAlias

public String PushAlias()
CODE

Method description: Gets the push session id, or alias, related to the retrieved push (if a CheckPush call returns a 0)

Returns: pushAlias (string)

PushAction

public String PushAction()
CODE

Method description: gets the push action type of the push notification (authenticate or activate)

Returns: pushAction (string)

PushContext

public String PushContext()
CODE

Method description: gets the push notification context information if there is one (authentication only)

Returns: pushContext (string)

Sealing

OnlineSealStart

public long OnlineSealStart(int i)
CODE

Method description: starts the “online seal generation” process

Parameters:

  • i (int) → the service index in the table of available services. For a standard configuration with one service, the service index is 0.

Returns: an error code

OnlineSealFinalize

public long OnlineSealFinalize(int i, String pin, String sealdata)
CODE

Method description: finalizes the “online seal generation” process

Parameters:

  • i(int) → the service index in the table of available services. For a standard configuration with one service, the service index is 0.

  • pin (string) → the user’s pin code

  • sealdata (string) → the data to seal (it is highly recommended to hash the data)

Returns: OnlineSealFinalizeExt(i, pin, 0, sealdata)

OnlineSealFinalizeExt

public long OnlineSealFinalizeExt(int i, String pin, long keyType, String sealdata)
CODE

Method description: finalizes the “online seal generation” process with biometric keys

Parameters:

  • i (int) → the service index in the table of available services. For a standard configuration with one service, the service index is 0.

  • pin (string) → description

  • keytype (long) → the keytype ( 0= pincode , 1= biometric key)

  • sealdata (string) → the data to seal (it is highly recommended to hash the data)

Returns: an error code

SealAnswerOtp

public String SealAnswerOtp()
CODE

Method description: retrieves a generated OTP after a process of seal generation (only if the OnlineSealFinalize or OnlineSealFinalizeExt call returns a response code “0”).

Returns: an OTP

SealShouldSynchronize

public long SealShouldSynchronize(int serviceid)
CODE

Method description: indicates if synchronization should be proposed to the user, BEFORE offline sealing. (i.e. before calling IWSealModeQuery ()). This would signify that more than 3 generations are performed in less than 2 minutes for the same service.

Parameters:

  • serviceid (int) → the service identifier

Returns: OtpShouldSynchronize(serviceid)

  • 0 → no synchronization required

  • 1 → synchronization required

SealModeQuery

public long SealModeQuery(int serviceid)
CODE

Method description: initializes the Offline Seal process indicating whether the pin should be requested

Parameters:

  • serviceid (int) → the service identifier

Returns: always returns 1 → pin is required

SealGenerate

public String SealGenerate(String pin, String sealdata)
CODE

Method description: generates the seal

Parameters:

  • pin (string) → the user’s pin code

  • sealdata (string) → the data to seal (it is highly recommended to hash the data)

Returns: the generated seal

Initialization and configuration

Init

public void Init(String SN, String DataAppli)
CODE

Method description: initializes the library

Parameters:

  • SN (string) → the device’s Serial Number - The SN is provided to the System variable Settings.Secure.ANDROID_ID: according to the documentation ‘a 64-bit number (expressed a 64-bit number hexadecimal string), unique to each combination of app-signing key, user, and device.’ More information about Settings.Secure class.

  • DataAppli (type) → timestamp of an install directory

SN and DataAppli parameters should be sent as ASCII strings.

VersionGet

public static String VersionGet()
CODE

Method description: gets the mAccess library version

Returns: the library version number LIBVERSION()

HostVersionSet

public void HostVersionSet(String version)
CODE

Method description: provides the host/application version number.

Parameters:

  • version (string) → the host/application version number. In order to be compliant with inWebo convention, it needs to be formatted as: AppName-Version. Example: myApp-1.3.0

WsTimeoutSet

public void WsTimeoutSet(long t)
CODE

Method description: defines the timeout value for the web service calls, in millisecond.

Parameters:

  • t (long) → the timeout value

WsServerSet

public void WsServerSet(String server)
CODE

Method description: defines the server value for the web service calls

Parameters:

LangSet

public void LangSet(String l)
CODE

Method description: defines the application language.

Parameters:

  • 1(string) → English

  • 2(string) → French

MaccessSet

public void MaccessSet(String macid)
CODE

Method description: provides the mAccess ID associated to its service

Parameters:

  • macid (strring) → the mAccess identifier associated to the service (see the integration guide to know more about the mAccess ID)

Storage

StorageDataChanged

public long StorageDataChanged()
CODE

Method description: indicates whether the stored data has changed. When true, the host should call IWStorageDataGet() and update the locally stored data.

Returns:

  • 0 → the stored data hasn’t changed

  • 1 → the stored data has changed

StorageDataGet

 public String StorageDataGet()
CODE

Method description: gets the data to be stored locally. This string contains the internal state of mAccess (keys, service description …). The host should not try to process this string: it should only store it locally.

Returns: The data to be stored (ASCII string)

StorageDataSet

public long StorageDataSet(String src)
CODE

Method description: provides the stored data to the library. This should be done only once, at initialization.

Parameters:

  • src (string) → the location of the stored data

Returns: an error code

  • ERR_OK → no error

  • ERR_SN → syntax error

Information

PinMode

 public long PinMode()
CODE

Method description: indicates the pin mode that should be used for the current process

Returns: pinmode

  • 0 → PINMODE_NONE

  • 1 → PINMODE_CURRENT

  • 2 → PINMODE_NEW

  • 8 → PINMODE_BIO

  • 9 → PINMODE_CURRENT | PINMODE_BIO

To know more, refer to “Pin Mode codes” table.

MajorVersionRequired

public long MajorVersionRequired()
CODE

Method description: indicates whether a major version update of the mAccess library is required.

Returns:

  • 0 → no major version update is required

  • 1 → a major version update is available and therefore required

NewVersionAvailable

public String NewVersionAvailable()
CODE

Method description: indicates whether a new version of the host/application is available

Returns:

  • If no new version is available, it returns empty string.

  • If a new version is available, it returns the name of this new version. Use IWMajorVersionRequired() to know whether this new version is major or minor.

NewVersionURL

public String NewVersionURL()
CODE

Method description: gets the URL new version

Returns:

  • If no new version is available, it returns empty string.

  • If a new version is available, it returns the URL to get the new version

ShouldAskForMinorUpdate

public long ShouldAskForMinorUpdate()
CODE

Method description: indicates whether a minor version update should be proposed to the user.

Returns: Returns 1 if a minor version update should be proposed to the user. After this function returns 1 once, it will always return 0.

IsActivated

 public long IsActivated()
CODE

Method description: indicates whether the application integrating mAccess library is activated, whether the account is activated with mAccess or not.

Returns:

  • 0 → the application is not activated

  • 1 → the application is activated

MustUpgrade

public long MustUpgrade()
CODE

Method description: indicates whether the application must upgrade first (the local data is from an old version).

Returns:

  • 0 → the application is up to date

  • 1 → the application must upgrade

IsBlocked

public long IsBlocked()
CODE

Method description: indicates whether the device is blocked. If yes, it has to be unlocked.

Returns:

  • 0 → the device is not blocked

  • 1 → the device is blocked

ServiceNb

public long ServiceNb()
CODE

Method description: indicates the number of services

Returns: “1” which means that the application is linked to one service.

ServiceName

public String ServiceName(int i)
CODE

Method description: indicates the name of the inWebo service linked to the application

Parameters:

  • i (int) → the service index in the table of available services. For a standard configuration with one service, the service index is 0.

Returns: the service name

public String ServiceLogo(int i)
CODE

Method description: indicates the URL of the service PNG logo.

Parameters:

  • i (int)the service index in the table of available services. For a standard configuration with one service, the service index is 0.

Returns: URL of the service logo

ServiceDisabled

public long ServiceDisabled(int i)
CODE

Method description: indicates whether the service is disabled or not.

Parameters:

  • i (int) → the service index in the table of available services. For a standard configuration with one service, the service index is 0.

Returns:

  • 0 → the service is not disabled

  • 1 → the service is disabled. When disabled, it may be displayed as grayed, and should not be accessible