/**@class android.security.KeyStore @extends java.lang.Object @hide This should not be made public in its present form because it assumes that private and secret key bytes are available and would preclude the use of hardware crypto. */ var KeyStore = { /***/ NO_ERROR : "1", /***/ LOCKED : "2", /***/ UNINITIALIZED : "3", /***/ SYSTEM_ERROR : "4", /***/ PROTOCOL_ERROR : "5", /***/ PERMISSION_DENIED : "6", /***/ KEY_NOT_FOUND : "7", /***/ VALUE_CORRUPTED : "8", /***/ UNDEFINED_ACTION : "9", /***/ WRONG_PASSWORD : "10", /***/ KEY_ALREADY_EXISTS : "16", /***/ CANNOT_ATTEST_IDS : "-66", /***/ HARDWARE_TYPE_UNAVAILABLE : "-68", /** Per operation authentication is needed before this operation is valid. This is returned from {@link #begin} when begin succeeds but the operation uses per-operation authentication and must authenticate before calling {@link #update} or {@link #finish}. */ OP_AUTH_NEEDED : "15", /***/ KEY_PERMANENTLY_INVALIDATED : "17", /***/ UID_SELF : "-1", /***/ FLAG_NONE : "0", /** Indicates that this key (or key pair) must be encrypted at rest. This will protect the key (or key pair) with the secure lock screen credential (e.g., password, PIN, or pattern). <p>Note that this requires that the secure lock screen (e.g., password, PIN, pattern) is set up, otherwise key (or key pair) generation or import will fail. Moreover, this key (or key pair) will be deleted when the secure lock screen is disabled or reset (e.g., by the user or a Device Administrator). Finally, this key (or key pair) cannot be used until the user unlocks the secure lock screen after boot. @see KeyguardManager#isDeviceSecure() */ FLAG_ENCRYPTED : "1", /** Select Software keymaster device, which as of this writing is the lowest security level available on an android device. If neither FLAG_STRONGBOX nor FLAG_SOFTWARE is provided A TEE based keymaster implementation is implied. Need to be in sync with KeyStoreFlag in system/security/keystore/include/keystore/keystore.h For historical reasons this corresponds to the KEYSTORE_FLAG_FALLBACK flag. */ FLAG_SOFTWARE : "2", /** A private flag that's only available to system server to indicate that this key is part of device encryption flow so it receives special treatment from keystore. For example this key will not be super encrypted, and it will be stored separately under an unique UID instead of the caller UID i.e. SYSTEM. Need to be in sync with KeyStoreFlag in system/security/keystore/include/keystore/keystore.h */ FLAG_CRITICAL_TO_DEVICE_ENCRYPTION : "8", /** Select Strongbox keymaster device, which as of this writing the the highest security level available an android devices. If neither FLAG_STRONGBOX nor FLAG_SOFTWARE is provided A TEE based keymaster implementation is implied. Need to be in sync with KeyStoreFlag in system/security/keystore/include/keystore/keystore.h */ FLAG_STRONGBOX : "16", /***/ CONFIRMATIONUI_OK : "0", /***/ CONFIRMATIONUI_CANCELED : "1", /***/ CONFIRMATIONUI_ABORTED : "2", /***/ CONFIRMATIONUI_OPERATION_PENDING : "3", /***/ CONFIRMATIONUI_IGNORED : "4", /***/ CONFIRMATIONUI_SYSTEM_ERROR : "5", /***/ CONFIRMATIONUI_UNIMPLEMENTED : "6", /***/ CONFIRMATIONUI_UNEXPECTED : "7", /***/ CONFIRMATIONUI_UIERROR : "65536", /***/ CONFIRMATIONUI_UIERROR_MISSING_GLYPH : "65537", /***/ CONFIRMATIONUI_UIERROR_MESSAGE_TOO_LONG : "65538", /***/ CONFIRMATIONUI_UIERROR_MALFORMED_UTF8_ENCODING : "65539", /** */ getApplicationContext : function( ) {}, /** */ getInstance : function( ) {}, /** */ state : function( ) {}, /** */ state : function( ) {}, /** */ isUnlocked : function( ) {}, /** */ get : function( ) {}, /** */ get : function( ) {}, /** */ get : function( ) {}, /** */ get : function( ) {}, /** */ put : function( ) {}, /** */ insert : function( ) {}, /** */ delete : function( ) {}, /** */ delete : function( ) {}, /** */ contains : function( ) {}, /** */ contains : function( ) {}, /**List all entries in the keystore for {@code uid} starting with {@code prefix}. */ list : function( ) {}, /**List uids of all keys that are auth bound to the current user. Only system is allowed to call this method. */ listUidsOfAuthBoundKeys : function( ) {}, /** */ list : function( ) {}, /** */ reset : function( ) {}, /**Attempt to lock the keystore for {@code user}. @param {Number} userId Android user to lock. @return {Boolean} whether {@code user}'s keystore was locked. */ lock : function( ) {}, /** */ lock : function( ) {}, /**Attempt to unlock the keystore for {@code user} with the password {@code password}. This is required before keystore entries created with FLAG_ENCRYPTED can be accessed or created. @param {Number} userId Android user ID to operate on @param {String} password user's keystore password. Should be the most recent value passed to {@link #onUserPasswordChanged} for the user. @return {Boolean} whether the keystore was unlocked. */ unlock : function( ) {}, /** */ unlock : function( ) {}, /**Check if the keystore for {@code userId} is empty. */ isEmpty : function( ) {}, /** */ isEmpty : function( ) {}, /** */ grant : function( ) {}, /** */ ungrant : function( ) {}, /**Returns the last modification time of the key in milliseconds since the epoch. Will return -1L if the key could not be found or other error. */ getmtime : function( ) {}, /** */ getmtime : function( ) {}, /** */ isHardwareBacked : function( ) {}, /** */ isHardwareBacked : function( ) {}, /** */ clearUid : function( ) {}, /** */ getLastError : function( ) {}, /** */ addRngEntropy : function( ) {}, /** */ generateKey : function( ) {}, /** */ generateKey : function( ) {}, /** */ getKeyCharacteristics : function( ) {}, /** */ getKeyCharacteristics : function( ) {}, /** */ importKey : function( ) {}, /** */ importKey : function( ) {}, /** */ importKey : function( ) {}, /** */ importWrappedKey : function( ) {}, /** */ exportKey : function( ) {}, /** */ exportKey : function( ) {}, /** */ begin : function( ) {}, /** */ begin : function( ) {}, /** */ update : function( ) {}, /** */ finish : function( ) {}, /** */ finish : function( ) {}, /** */ abort : function( ) {}, /**Add an authentication record to the keystore authorization table. @param {Object {byte[]}} authToken The packed bytes of a hw_auth_token_t to be provided to keymaster. @return {Number} {@code KeyStore.NO_ERROR} on success, otherwise an error value corresponding to a {@code KeymasterDefs.KM_ERROR_} value or {@code KeyStore} ResponseCode. */ addAuthToken : function( ) {}, /**Notify keystore that a user's password has changed. @param {Number} userId the user whose password changed. @param {String} newPassword the new password or "" if the password was removed. */ onUserPasswordChanged : function( ) {}, /**Notify keystore that a user was added. @param {Number} userId the new user. @param {Number} parentId the parent of the new user, or -1 if the user has no parent. If parentId is specified then the new user's keystore will be intialized with the same secure lockscreen password as the parent. */ onUserAdded : function( ) {}, /**Notify keystore that a user was added. @param {Number} userId the new user. */ onUserAdded : function( ) {}, /**Notify keystore that a user was removed. @param {Number} userId the removed user. */ onUserRemoved : function( ) {}, /** */ onUserPasswordChanged : function( ) {}, /** */ attestKey : function( ) {}, /** */ attestDeviceIds : function( ) {}, /**Notify keystore that the device went off-body. */ onDeviceOffBody : function( ) {}, /**Requests keystore call into the confirmationui HAL to display a prompt. @param {Object {IBinder}} listener the binder to use for callbacks. @param {String} promptText the prompt to display. @param {Object {byte[]}} extraData extra data / nonce from application. @param {String} locale the locale as a BCP 47 langauge tag. @param {Number} uiOptionsAsFlags the UI options to use, as flags. @return {Number} one of the {@code CONFIRMATIONUI_*} constants, for example {@code KeyStore.CONFIRMATIONUI_OK}. */ presentConfirmationPrompt : function( ) {}, /**Requests keystore call into the confirmationui HAL to cancel displaying a prompt. @param {Object {IBinder}} listener the binder passed to the {@link #presentConfirmationPrompt} method. @return {Number} one of the {@code CONFIRMATIONUI_*} constants, for example {@code KeyStore.CONFIRMATIONUI_OK}. */ cancelConfirmationPrompt : function( ) {}, /**Requests keystore to check if the confirmationui HAL is available. @return {Boolean} whether the confirmationUI HAL is available. */ isConfirmationPromptSupported : function( ) {}, /**Returns a {@link android.security.KeyStoreException} corresponding to the provided keystore/keymaster error code. */ getKeyStoreException : function( ) {}, /**Returns an {@link InvalidKeyException} corresponding to the provided {@link android.security.KeyStoreException}. */ getInvalidKeyException : function( ) {}, /**Returns an {@link InvalidKeyException} corresponding to the provided keystore/keymaster error code. */ getInvalidKeyException : function( ) {}, };