# EncryptedSharedPreferences.PrefValueEncryptionScheme

Artifact: [androidx.security:security-crypto](https://developer.android.com/jetpack/androidx/releases/security) [View Source](https://cs.android.com/search?q=file:androidx/security/crypto/EncryptedSharedPreferences.java+class:androidx.security.crypto.EncryptedSharedPreferences.PrefValueEncryptionScheme) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/security#1.0.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/security#1.1.0)

*** ** * ** ***


```
public enum EncryptedSharedPreferences.PrefValueEncryptionScheme
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This enum is deprecated.**   
>
> Use `https://developer.android.com/reference/android/content/SharedPreferences.html` instead.

The encryption scheme to encrypt values.

## Summary

| ### Enum Values |
|---|---|
| `https://developer.android.com/reference/androidx/security/crypto/EncryptedSharedPreferences.PrefValueEncryptionScheme#AES256_GCM` | **This enum value is deprecated.** Deprecated in Java |

| ### Public methods |
|---|---|
| `static https://developer.android.com/reference/androidx/security/crypto/EncryptedSharedPreferences.PrefValueEncryptionScheme` | `[valueOf](https://developer.android.com/reference/androidx/security/crypto/EncryptedSharedPreferences.PrefValueEncryptionScheme#valueOf(java.lang.String))(https://developer.android.com/reference/java/lang/String.html name)` **This method is deprecated.** Deprecated in Java |
| `static EncryptedSharedPreferences.PrefValueEncryptionScheme[]` | `[values](https://developer.android.com/reference/androidx/security/crypto/EncryptedSharedPreferences.PrefValueEncryptionScheme#values())()` **This method is deprecated.** Deprecated in Java |

## Enum Values

### AES256_GCM

```
EncryptedSharedPreferences.PrefValueEncryptionScheme EncryptedSharedPreferences.PrefValueEncryptionScheme.AES256_GCM
```

> [!CAUTION]
> **This enum value is deprecated.**   
> Deprecated in Java

Pref values are encrypted with AES256-GCM. The associated data is the encrypted pref key.

For more information please see the Tink documentation:

[AesGcmKeyManager](https://google.github.io/tink/javadoc/tink/1.7.0/com/google/crypto/tink/aead/AesGcmKeyManager.html).aes256GcmTemplate()

## Public methods

### valueOf

Added in 1.0.0 Deprecated in 1.1.0

```
public static EncryptedSharedPreferences.PrefValueEncryptionScheme [valueOf](https://developer.android.com/reference/androidx/security/crypto/EncryptedSharedPreferences.PrefValueEncryptionScheme#valueOf(java.lang.String))(String name)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/security/crypto/EncryptedSharedPreferences.PrefValueEncryptionScheme` | the enum constant with the specified name |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if this enum type has no constant with the specified name |

### values

Added in 1.0.0 Deprecated in 1.1.0

```
public static EncryptedSharedPreferences.PrefValueEncryptionScheme[] [values](https://developer.android.com/reference/androidx/security/crypto/EncryptedSharedPreferences.PrefValueEncryptionScheme#values())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants.

| Returns |
|---|---|
| `EncryptedSharedPreferences.PrefValueEncryptionScheme[]` | an array containing the constants of this enum type, in the order they're declared |