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.

ConstantReturned Via
PRIVAKEY_INITIALIZEDonInitializeResult(String result) if setup was successful.
ACCOUNT_CREATEDonEnablePrivakeyResult(String result, PrivakeyAccount account) if the CX Library created an account and tokenize the device.
DEVICE_REVOKEDonRevokeAllCredentialsResult(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_DISABLEDonDisablePrivakeyResult(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_UPDATEDonChangePasswordResult(String result) if the CX Library updated the password on the authorization key.
REQUEST_PROCESSEDonRequestActionResult(String result) if the CX Library processed a request.
DEVICE_UPDATEDonUpdateDeviceResult(String result) if the CX Library updated the device reference on the CX Server and the local device data.
TELEMETRY_POSTEDonRecordTelemetryResult(String result) if the telemetry event was uploaded to the CX server.
CREDENTIALS_ADDEDonAddAppSpaceCredentialResult(String result) if app space credentials were successfully created on the device.
CURRENT_PIN_VERIFIEDonVerifyCurrentPasswordResult(String result) if the entered password is verified.

CallbackSuccessStrings.Biometrics

public static class CallbackSuccessStrings {
  public static class Biometrics
}

All biometric-related success constants.

ConstantReturned Via
BIOMETRIC_ENABLEDonBiometricResult(String result) if a biometric key pair was generated for the device.
BIOMETRIC_DISABLEDonBiometricResult(String result) if the biometric key pair was deleted.
BIOMETRICS_AVAILABLEonBiometricAvailabilityResult (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_READYonBiometricResult(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.

ConstantDescription
ACCOUNT_EXISTSOccurs 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_OCCURREDGeneric catch-all error if something went wrong.
INVALID_SESSION_TOKENReturned if the sessionToken for enablePrivakeySessionToken is null, empty, already been used, or is expired.
INVALID_TRANSACTION_IDReturned if the transactionId for enablePrivakeyOIDC is null, empty, already been used, or is expired.
INVALID_PASSWORDReturned if the password/PIN used to unlock the authorization key is invalid.
INVALID_NEW_PASSWORDReturned from changePassword if the new password is null, or empty.
INVALID_PRIVAKEY_IDReturned if the provided privakeyId does not exist on the device.
ANDROID_SDK_NOT_SUPPORTEDReturned if enableBiometric() or disableBiometric() is called on an Android device running an API less than 23.
INVALID_NOTIFICATION_IDReturned if the notificationId is null when calling updatedDevice() or enablePrivakey().
INVALID_NOTIFICATION_FRAMEWORKReturned if the notificationFramework is null when calling updatedDevice() or enablePrivakey().
INVALID_REQUEST_GUIDReturned 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_GUIDReturned 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_RESPONSEReturned if the CX server responds with an HTTP code that is not supported by the CX Library.
INVALID_PRIVAKEY_URLReturned if the privakey_url in the privakey_config.properties is not set or is an invalid URL.
INVALID_REQUEST_STATUSReturned when searching for a request whose status is not found in the RequestStatus enum.
REQUEST_UNPROCESSABLEReturned when attempting to process a request that is timedout or already processed by another device.
INVALID_BUTTON_INDEXReturned during processRequest() if the Request's selected button index is greater or less than the button array size.
PRIVAKEY_NOT_INITALIZEDReturned by any call that is made to the CX Library before the initialize is called.
ANDROID_CONTEXT_NULLReturned if the Android context is set to null. The Android Application context is required to perform database operations.
REVOKEDReturned 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_REVOKEDReturned 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_SUSPENDEDReturned by any call that tries to perform an action with a device that has been suspended by an admin.
TOKEN_SUSPENDEDReturned 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_DATAReturned by returnTelemetry() when any of the data is null or empty.
NO_ACCOUNTReturned when any action is taken before Privakey is enabled.
UNAUTHORIZEDReturned by enablePrivakeySessionToken() when the session token is expired or otherwise invalid.
INVALID_APP_SPACE_GUIDReturned if the supplied App Space Guid is null or empty.
STORE_ENTITIES_TO_DATABASE_FAILEDReturned if there is a database error while calling changePassword().
PIN_HASH_GENERATION_FAILEDReturned by changePassword() if there is an error generating the hash of the new password.
UPDATING_DEVICE_KEY_FAILEDReturned by changePassword() if the keys failed to save. (Only applies to Android 4 devices)
CHANGE_PIN_LOCKED_OUTReturned by changePassword() and verifyCurrentPassword() if the old password or current password is incorrect and there are no pin tries remaining.
APP_SPACE_BOUNDReturned by addAppSpaceCredential() if the credential was already added.
NO_BIOMETRIC_HARDWAREReturned by isBiometricSensorAvailable() when the device doesn't have a biometric sensor.
BIOMETRICS_NOT_AVAILABLEReturned by isBiometricSensorAvailable() when the device's biometric sensor is unavailable to use.
BIOMETRICS_NOT_ENROLLEDReturned by isBiometricSensorAvailable() when the device's user doesn't have any biometrics enrolled.
BIOMETRIC_AUTHENTICATION_FAILUREReturned when a biometric match fails.
BIOMETRIC_CANCELEDReturned when the user cancels a displayed biometric prompt.
TOO_MANY_BIOMETRIC_ATTEMPTSReturned when too many failed biometric attempts were made. This occurs after 5 failed attempts, and lasts for 30 seconds.
BIOMETRICS_LOCKED_OUTReturned 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_INVALIDReturned 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_SETReturned by isBiometricEnabled() if the Privakey CX Library hasn't generated a biometric key.