# android.security.keystore

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

# android.security.keystore

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/security/keystore/package-summary "View this page in Kotlin")\|Java

## Classes

|------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [KeyGenParameterSpec](https://developer.android.com/reference/android/security/keystore/KeyGenParameterSpec)                 | [AlgorithmParameterSpec](https://developer.android.com/reference/java/security/spec/AlgorithmParameterSpec)for initializing a[KeyPairGenerator](https://developer.android.com/reference/java/security/KeyPairGenerator)or a[KeyGenerator](https://developer.android.com/reference/javax/crypto/KeyGenerator)of the[Android Keystore system](https://developer.android.com/training/articles/keystore). |
| [KeyGenParameterSpec.Builder](https://developer.android.com/reference/android/security/keystore/KeyGenParameterSpec.Builder) | Builder of[KeyGenParameterSpec](https://developer.android.com/reference/android/security/keystore/KeyGenParameterSpec)instances.                                                                                                                                                                                                                                                                       |
| [KeyInfo](https://developer.android.com/reference/android/security/keystore/KeyInfo)                                         | Information about a key from the[Android Keystore system](https://developer.android.com/training/articles/keystore).                                                                                                                                                                                                                                                                                   |
| [KeyProperties](https://developer.android.com/reference/android/security/keystore/KeyProperties)                             | Properties of[Android Keystore](https://developer.android.com/training/articles/keystore)keys.                                                                                                                                                                                                                                                                                                         |
| [KeyProtection](https://developer.android.com/reference/android/security/keystore/KeyProtection)                             | Specification of how a key or key pair is secured when imported into the[Android Keystore system](https://developer.android.com/training/articles/keystore).                                                                                                                                                                                                                                           |
| [KeyProtection.Builder](https://developer.android.com/reference/android/security/keystore/KeyProtection.Builder)             | Builder of[KeyProtection](https://developer.android.com/reference/android/security/keystore/KeyProtection)instances.                                                                                                                                                                                                                                                                                   |
| [KeyStoreManager](https://developer.android.com/reference/android/security/keystore/KeyStoreManager)                         | This class provides methods for interacting with keys stored within the[Android Keystore](https://developer.android.com/privacy-and-security/keystore).                                                                                                                                                                                                                                                |
| [WrappedKeyEntry](https://developer.android.com/reference/android/security/keystore/WrappedKeyEntry)                         | An[Entry](https://developer.android.com/reference/java/security/KeyStore.Entry)that holds a wrapped key.                                                                                                                                                                                                                                                                                               |

## Exceptions

|----------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------|
| [BackendBusyException](https://developer.android.com/reference/android/security/keystore/BackendBusyException)                               | Indicates a transient error that prevented a key operation from being created.                                               |
| [KeyExpiredException](https://developer.android.com/reference/android/security/keystore/KeyExpiredException)                                 | Indicates that a cryptographic operation failed because the employed key's validity end date is in the past.                 |
| [KeyNotYetValidException](https://developer.android.com/reference/android/security/keystore/KeyNotYetValidException)                         | Indicates that a cryptographic operation failed because the employed key's validity start date is in the future.             |
| [KeyPermanentlyInvalidatedException](https://developer.android.com/reference/android/security/keystore/KeyPermanentlyInvalidatedException)   | Indicates that the key can no longer be used because it has been permanently invalidated.                                    |
| [SecureKeyImportUnavailableException](https://developer.android.com/reference/android/security/keystore/SecureKeyImportUnavailableException) | Indicates that the Keystore does not support securely importing wrapped keys.                                                |
| [StrongBoxUnavailableException](https://developer.android.com/reference/android/security/keystore/StrongBoxUnavailableException)             | Indicates that an operation could not be performed because the requested security hardware is not available.                 |
| [UserNotAuthenticatedException](https://developer.android.com/reference/android/security/keystore/UserNotAuthenticatedException)             | Indicates that a cryptographic operation could not be performed because the user has not been authenticated recently enough. |
| [UserPresenceUnavailableException](https://developer.android.com/reference/android/security/keystore/UserPresenceUnavailableException)       | Indicates the condition that a proof of user-presence was requested but this proof was not presented.                        |

-

  ## Classes

  - [KeyGenParameterSpec](https://developer.android.com/reference/android/security/keystore/KeyGenParameterSpec)
  - [KeyGenParameterSpec.Builder](https://developer.android.com/reference/android/security/keystore/KeyGenParameterSpec.Builder)
  - [KeyInfo](https://developer.android.com/reference/android/security/keystore/KeyInfo)
  - [KeyProperties](https://developer.android.com/reference/android/security/keystore/KeyProperties)
  - [KeyProtection](https://developer.android.com/reference/android/security/keystore/KeyProtection)
  - [KeyProtection.Builder](https://developer.android.com/reference/android/security/keystore/KeyProtection.Builder)
  - [KeyStoreManager](https://developer.android.com/reference/android/security/keystore/KeyStoreManager)
  - [WrappedKeyEntry](https://developer.android.com/reference/android/security/keystore/WrappedKeyEntry)
-

  ## Exceptions

  - [BackendBusyException](https://developer.android.com/reference/android/security/keystore/BackendBusyException)
  - [KeyExpiredException](https://developer.android.com/reference/android/security/keystore/KeyExpiredException)
  - [KeyNotYetValidException](https://developer.android.com/reference/android/security/keystore/KeyNotYetValidException)
  - [KeyPermanentlyInvalidatedException](https://developer.android.com/reference/android/security/keystore/KeyPermanentlyInvalidatedException)
  - [SecureKeyImportUnavailableException](https://developer.android.com/reference/android/security/keystore/SecureKeyImportUnavailableException)
  - [StrongBoxUnavailableException](https://developer.android.com/reference/android/security/keystore/StrongBoxUnavailableException)
  - [UserNotAuthenticatedException](https://developer.android.com/reference/android/security/keystore/UserNotAuthenticatedException)
  - [UserPresenceUnavailableException](https://developer.android.com/reference/android/security/keystore/UserPresenceUnavailableException)