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

# android.security

*** ** * ** ***

Provides access to a few facilities of the Android security
subsystems.

## Interfaces

|---|---|
| [KeyChainAliasCallback](https://developer.android.com/reference/android/security/KeyChainAliasCallback) | The KeyChainAliasCallback is the callback for `https://developer.android.com/reference/android/security/KeyChain#choosePrivateKeyAlias(android.app.Activity,%20android.security.KeyChainAliasCallback,%20java.lang.String[],%20java.security.Principal[],%20android.net.Uri,%20java.lang.String)`. |

## Classes

|---|---|
| [AppUriAuthenticationPolicy](https://developer.android.com/reference/android/security/AppUriAuthenticationPolicy) | The app-URI authentication policy is set by the credential management app. |
| [AppUriAuthenticationPolicy.Builder](https://developer.android.com/reference/android/security/AppUriAuthenticationPolicy.Builder) | Builder class for `https://developer.android.com/reference/android/security/AppUriAuthenticationPolicy` objects. |
| [AttestedKeyPair](https://developer.android.com/reference/android/security/AttestedKeyPair) | The `AttestedKeyPair` class contains a `KeyPair` instance of keys generated by Keystore and owned by KeyChain, as well as an attestation record for the key. |
| [ConfirmationCallback](https://developer.android.com/reference/android/security/ConfirmationCallback) | Callback class used when signaling that a prompt is no longer being presented. |
| [ConfirmationPrompt](https://developer.android.com/reference/android/security/ConfirmationPrompt) | Class used for displaying confirmation prompts. |
| [ConfirmationPrompt.Builder](https://developer.android.com/reference/android/security/ConfirmationPrompt.Builder) | A builder that collects arguments, to be shown on the system-provided confirmation prompt. |
| [FileIntegrityManager](https://developer.android.com/reference/android/security/FileIntegrityManager) | This class provides access to file integrity related operations. |
| [GrantedKeyInfo](https://developer.android.com/reference/android/security/GrantedKeyInfo) | Information about a key pair granted to an application via KeyChain. |
| [KeyChain](https://developer.android.com/reference/android/security/KeyChain) | The `KeyChain` class provides access to private keys and their corresponding certificate chains in credential storage. |
| [KeyChainManager](https://developer.android.com/reference/android/security/KeyChainManager) | Manages KeyChain certificates and grants. |
| [KeyPairGeneratorSpec](https://developer.android.com/reference/android/security/KeyPairGeneratorSpec) | *This class was deprecated in API level 23. Use `https://developer.android.com/reference/android/security/keystore/KeyGenParameterSpec` instead.* |
| [KeyPairGeneratorSpec.Builder](https://developer.android.com/reference/android/security/KeyPairGeneratorSpec.Builder) | *This class was deprecated in API level 23. Use `https://developer.android.com/reference/android/security/keystore/KeyGenParameterSpec.Builder` instead.* |
| [KeyStoreParameter](https://developer.android.com/reference/android/security/KeyStoreParameter) | *This class was deprecated in API level 23. Use `https://developer.android.com/reference/android/security/keystore/KeyProtection` instead.* |
| [KeyStoreParameter.Builder](https://developer.android.com/reference/android/security/KeyStoreParameter.Builder) | *This class was deprecated in API level 23. Use `https://developer.android.com/reference/android/security/keystore/KeyProtection.Builder` instead.* |
| [NetworkSecurityPolicy](https://developer.android.com/reference/android/security/NetworkSecurityPolicy) | Network security policy. |
| [NetworkSecurityPolicy.Builder](https://developer.android.com/reference/android/security/NetworkSecurityPolicy.Builder) | A builder for a `https://developer.android.com/reference/android/security/NetworkSecurityPolicy`. |

## Exceptions

|---|---|
| [ConfirmationAlreadyPresentingException](https://developer.android.com/reference/android/security/ConfirmationAlreadyPresentingException) | This exception is thrown when presenting a prompt fails because another prompt is already being presented. |
| [ConfirmationNotAvailableException](https://developer.android.com/reference/android/security/ConfirmationNotAvailableException) | This exception is thrown when presenting a prompt fails because the environment lacks facilities for showing confirmations. |
| [KeyChainException](https://developer.android.com/reference/android/security/KeyChainException) | Thrown on problems accessing the `https://developer.android.com/reference/android/security/KeyChain`. |
| [KeyStoreException](https://developer.android.com/reference/android/security/KeyStoreException) | Exception containing information about the failure at the Keystore / KeyMint layer while generating or using a key. |

-

  ## Interfaces

  - [KeyChainAliasCallback](https://developer.android.com/reference/android/security/KeyChainAliasCallback)
-

  ## Classes

  - [AppUriAuthenticationPolicy](https://developer.android.com/reference/android/security/AppUriAuthenticationPolicy)
  - [AppUriAuthenticationPolicy.Builder](https://developer.android.com/reference/android/security/AppUriAuthenticationPolicy.Builder)
  - [AttestedKeyPair](https://developer.android.com/reference/android/security/AttestedKeyPair)
  - [ConfirmationCallback](https://developer.android.com/reference/android/security/ConfirmationCallback)
  - [ConfirmationPrompt](https://developer.android.com/reference/android/security/ConfirmationPrompt)
  - [ConfirmationPrompt.Builder](https://developer.android.com/reference/android/security/ConfirmationPrompt.Builder)
  - [FileIntegrityManager](https://developer.android.com/reference/android/security/FileIntegrityManager)
  - [GrantedKeyInfo](https://developer.android.com/reference/android/security/GrantedKeyInfo)
  - [KeyChain](https://developer.android.com/reference/android/security/KeyChain)
  - [KeyChainManager](https://developer.android.com/reference/android/security/KeyChainManager)
  - [KeyPairGeneratorSpec](https://developer.android.com/reference/android/security/KeyPairGeneratorSpec)
  - [KeyPairGeneratorSpec.Builder](https://developer.android.com/reference/android/security/KeyPairGeneratorSpec.Builder)
  - [KeyStoreParameter](https://developer.android.com/reference/android/security/KeyStoreParameter)
  - [KeyStoreParameter.Builder](https://developer.android.com/reference/android/security/KeyStoreParameter.Builder)
  - [NetworkSecurityPolicy](https://developer.android.com/reference/android/security/NetworkSecurityPolicy)
  - [NetworkSecurityPolicy.Builder](https://developer.android.com/reference/android/security/NetworkSecurityPolicy.Builder)
-

  ## Exceptions

  - [ConfirmationAlreadyPresentingException](https://developer.android.com/reference/android/security/ConfirmationAlreadyPresentingException)
  - [ConfirmationNotAvailableException](https://developer.android.com/reference/android/security/ConfirmationNotAvailableException)
  - [KeyChainException](https://developer.android.com/reference/android/security/KeyChainException)
  - [KeyStoreException](https://developer.android.com/reference/android/security/KeyStoreException)