Constants
public final class Constants extends Object
Summary
PrivakeyCX library uses String constants as success and error results for the callbacks.
CallbackSuccessStrings
public static class CallbackSuccessStrings
All the possible success statuses that can be returned by the CX Library via callbacks or the PrivakeyCX class as the result
variable.
Constant | Returned Via |
---|---|
PRIVAKEY_INITIALIZED | onInitializeResult(String result) if setup was successful. |
ACCOUNT_CREATED | onEnablePrivakeyResult(String result, PrivakeyAccount account) if the CX Library created an account and tokenize the device. |
DEVICE_REVOKED | onRevokeAllCredentialsResult(String result) if the CX Library notified the CX Server that the device can no longer process requests. If the current device is revoking itself, the account data will be deleted as well. |
PRIVAKEY_DISABLED | onDisablePrivakeyResult(String result) if the CX Library notified the server that the current device can no longer process requests and that the account data was deleted. |
PASSWORD_UPDATED | onChangePasswordResult(String result) if the CX Library updated the password on the authorization key. |
REQUEST_PROCESSED | onRequestActionResult(String result) if the CX Library processed a request. |
DEVICE_UPDATED | onUpdateDeviceResult(String result) if the CX Library updated the device reference on the CX Server and the local device data. |
TELEMETRY_POSTED | onRecordTelemetryResult(String result) if the telemetry event was uploaded to the CX server. |
CREDENTIALS_ADDED | onAddAppSpaceCredentialResult(String result) if app space credentials were successfully created on the device. |
CURRENT_PIN_VERIFIED | onVerifyCurrentPasswordResult(String result) if the entered password is verified. |
CallbackSuccessStrings.Biometrics
public static class CallbackSuccessStrings {
public static class Biometrics
}
All biometric-related success constants.
Constant | Returned Via |
---|---|
BIOMETRIC_ENABLED | onBiometricResult(String result) if a biometric key pair was generated for the device. |
BIOMETRIC_DISABLED | onBiometricResult(String result) if the biometric key pair was deleted. |
BIOMETRICS_AVAILABLE | onBiometricAvailabilityResult (boolean isAvailable, String message) if the app can authenticate using biometrics. Checks whether the current device has biometric hardware, that the biometric hardware is currently available, and that the user has biometrics enrolled on the device that can be used. |
BIOMETRIC_KEY_READY | onBiometricResult(String result) if the biometric key is set and valid. |
CallbackErrorStrings
public static class CallbackErrorStrings
All the possible error statuses that can be returned by the CX Library via callbacks or the PrivakeyCX class as the result
or error
variables.
Constant | Description |
---|---|
ACCOUNT_EXISTS | Occurs when an enablePrivakey call is made for a privakeyId that is already enabled on the device. Each device can only have 1 instance of a privakeyId. Call DisablePrivakey to remove the account. |
ERROR_OCCURRED | Generic catch-all error if something went wrong. |
INVALID_SESSION_TOKEN | Returned if the sessionToken for enablePrivakeySessionToken is null, empty, already been used, or is expired. |
INVALID_TRANSACTION_ID | Returned if the transactionId for enablePrivakeyOIDC is null, empty, already been used, or is expired. |
INVALID_PASSWORD | Returned if the password/PIN used to unlock the authorization key is invalid. |
INVALID_NEW_PASSWORD | Returned from changePassword if the new password is null, or empty. |
INVALID_PRIVAKEY_ID | Returned if the provided privakeyId does not exist on the device. |
ANDROID_SDK_NOT_SUPPORTED | Returned if enableBiometric() or disableBiometric() is called on an Android device running an API less than 23. |
INVALID_NOTIFICATION_ID | Returned if the notificationId is null when calling updatedDevice() or enablePrivakey() . |
INVALID_NOTIFICATION_FRAMEWORK | Returned if the notificationFramework is null when calling updatedDevice() or enablePrivakey() . |
INVALID_REQUEST_GUID | Returned if processRequest() or getRequest() is called with a requestGuid that does not belong to the account linked by privakeyId, or if the request is not found on the CX Server. |
INVALID_DEVICE_GUID | Returned if updateDevice() or getDevice() is called with a deviceGuid that does not belong to the account linked by privakeyId, of if the device is not found on the CX Server. |
UNSUPPORTED_RESPONSE | Returned if the CX server responds with an HTTP code that is not supported by the CX Library. |
INVALID_PRIVAKEY_URL | Returned if the privakey_url in the privakey_config.properties is not set or is an invalid URL. |
INVALID_REQUEST_STATUS | Returned when searching for a request whose status is not found in the RequestStatus enum. |
REQUEST_UNPROCESSABLE | Returned when attempting to process a request that is timedout or already processed by another device. |
INVALID_BUTTON_INDEX | Returned during processRequest() if the Request's selected button index is greater or less than the button array size. |
PRIVAKEY_NOT_INITALIZED | Returned by any call that is made to the CX Library before the initialize is called. |
ANDROID_CONTEXT_NULL | Returned if the Android context is set to null. The Android Application context is required to perform database operations. |
REVOKED | Returned by any call that tries to perform an action with a device that has been revoked. The device needs to be rebound before it can process requests. |
KEY_REVOKED | Returned by any call that tries to perform an action with a key that has been revoked. The App Space needs to be rebound before it can process requests. |
ADMIN_SUSPENDED | Returned by any call that tries to perform an action with a device that has been suspended by an admin. |
TOKEN_SUSPENDED | Returned by any call that tries to perform an action with a device that has been token suspended. The account must re-authenticate with the CX Server to refresh the token. |
INVALID_TELEMETRY_DATA | Returned by returnTelemetry() when any of the data is null or empty. |
NO_ACCOUNT | Returned when any action is taken before Privakey is enabled. |
UNAUTHORIZED | Returned by enablePrivakeySessionToken() when the session token is expired or otherwise invalid. |
INVALID_APP_SPACE_GUID | Returned if the supplied App Space Guid is null or empty. |
STORE_ENTITIES_TO_DATABASE_FAILED | Returned if there is a database error while calling changePassword() . |
PIN_HASH_GENERATION_FAILED | Returned by changePassword() if there is an error generating the hash of the new password. |
UPDATING_DEVICE_KEY_FAILED | Returned by changePassword() if the keys failed to save. (Only applies to Android 4 devices) |
CHANGE_PIN_LOCKED_OUT | Returned by changePassword() and verifyCurrentPassword() if the old password or current password is incorrect and there are no pin tries remaining. |
APP_SPACE_BOUND | Returned by addAppSpaceCredential() if the credential was already added. |
NO_BIOMETRIC_HARDWARE | Returned by isBiometricSensorAvailable() when the device doesn't have a biometric sensor. |
BIOMETRICS_NOT_AVAILABLE | Returned by isBiometricSensorAvailable() when the device's biometric sensor is unavailable to use. |
BIOMETRICS_NOT_ENROLLED | Returned by isBiometricSensorAvailable() when the device's user doesn't have any biometrics enrolled. |
BIOMETRIC_AUTHENTICATION_FAILURE | Returned when a biometric match fails. |
BIOMETRIC_CANCELED | Returned when the user cancels a displayed biometric prompt. |
TOO_MANY_BIOMETRIC_ATTEMPTS | Returned when too many failed biometric attempts were made. This occurs after 5 failed attempts, and lasts for 30 seconds. |
BIOMETRICS_LOCKED_OUT | Returned when TOO_MANY_BIOMETRIC_ATTEMPTS occurs too many times. Biometric authentication is disabled until the user unlocks the Android device with strong authentication (PIN/Pattern/Password). |
BIOMETRIC_KEY_INVALID | Returned when the biometric key can no longer be used because it has been permanently invalidated. This occurs if the user disables, reconfigures, or resets the secure lock screen as well as when new biometrics are enrolled or removed. |
BIOMETRIC_KEY_NOT_SET | Returned by isBiometricEnabled() if the Privakey CX Library hasn't generated a biometric key. |
Updated almost 4 years ago