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

# Capability

```
class Capability
```

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) |||
| ↳ | [kotlin.Enum](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html)\<[java.security.DrbgParameters.Capability](https://developer.android.com/reference/kotlin/java/security/DrbgParameters.Capability#)\> ||
|   | ↳ | [java.security.DrbgParameters.Capability](https://developer.android.com/reference/kotlin/java/security/DrbgParameters.Capability#) |

|---|
| Known Direct Subclasses [DrbgParameters.Capability.NONE](https://developer.android.com/reference/kotlin/java/security/DrbgParameters.Capability#ENUM_VALUE:NONE), [DrbgParameters.Capability.PR_AND_RESEED](https://developer.android.com/reference/kotlin/java/security/DrbgParameters.Capability#ENUM_VALUE:PR_AND_RESEED), [DrbgParameters.Capability.RESEED_ONLY](https://developer.android.com/reference/kotlin/java/security/DrbgParameters.Capability#ENUM_VALUE:RESEED_ONLY) |---|---| | [DrbgParameters.Capability.NONE](https://developer.android.com/reference/kotlin/java/security/DrbgParameters.Capability#ENUM_VALUE:NONE) | Neither prediction resistance nor reseed. | | [DrbgParameters.Capability.PR_AND_RESEED](https://developer.android.com/reference/kotlin/java/security/DrbgParameters.Capability#ENUM_VALUE:PR_AND_RESEED) | Both prediction resistance and reseed. | | [DrbgParameters.Capability.RESEED_ONLY](https://developer.android.com/reference/kotlin/java/security/DrbgParameters.Capability#ENUM_VALUE:RESEED_ONLY) | Reseed but no prediction resistance. | |

The reseedable and prediction resistance capabilities of a DRBG.

When this object is passed to a `SecureRandom.getInstance()` call, it is the requested minimum capability. When it's returned from `SecureRandom.getParameters()`, it is the effective capability.

Please note that while the `Instantiate_function` defined in NIST SP 800-90Ar1 only includes a `prediction_resistance_flag` parameter, the `Capability` type includes an extra value `https://developer.android.com/reference/kotlin/java/security/DrbgParameters.Capability#` because reseeding is an optional function. If `NONE` is used in an `Instantiation` object in calling the `SecureRandom.getInstance` method, the returned DRBG instance is not guaranteed to support reseeding. If `RESEED_ONLY` or `PR_AND_RESEED` is used, the instance must support reseeding.

The table below lists possible effective values if a certain capability is requested, i.e.

```kotlin
Capability requested = ...;
  SecureRandom s = SecureRandom.getInstance("DRBG",
          DrbgParameters(-1, requested, null));
  Capability effective = ((DrbgParametes.Initiate) s.getParameters())
          .getCapability();
```

| Requested Value | Possible Effective Values |
| NONE | NONE, RESEED_ONLY, PR_AND_RESEED |
| RESEED_ONLY | RESEED_ONLY, PR_AND_RESEED |
| PR_AND_RESEED | PR_AND_RESEED |
|---|---|

A DRBG implementation supporting prediction resistance must also support reseeding.

## Summary

| Enum values ||
|---|---|
| `https://developer.android.com/reference/kotlin/java/security/DrbgParameters.Capability#ENUM_VALUE:NONE` Neither prediction resistance nor reseed. |
| `https://developer.android.com/reference/kotlin/java/security/DrbgParameters.Capability#ENUM_VALUE:PR_AND_RESEED` Both prediction resistance and reseed. |
| `https://developer.android.com/reference/kotlin/java/security/DrbgParameters.Capability#ENUM_VALUE:RESEED_ONLY` Reseed but no prediction resistance. |

| Public methods ||
|---|---|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `https://developer.android.com/reference/kotlin/java/security/DrbgParameters.Capability#supportsPredictionResistance()()` Returns whether this capability supports prediction resistance. |
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `https://developer.android.com/reference/kotlin/java/security/DrbgParameters.Capability#supportsReseeding()()` Returns whether this capability supports reseeding. |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/java/security/DrbgParameters.Capability#toString()()` Returns the name of this enum constant, as contained in the declaration. |

## Enum values

### NONE

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

```
enum val NONE : DrbgParameters.Capability
```

Neither prediction resistance nor reseed.

### PR_AND_RESEED

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

```
enum val PR_AND_RESEED : DrbgParameters.Capability
```

Both prediction resistance and reseed.

### RESEED_ONLY

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

```
enum val RESEED_ONLY : DrbgParameters.Capability
```

Reseed but no prediction resistance.

## Public methods

### supportsPredictionResistance

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

```
fun supportsPredictionResistance(): Boolean
```

Returns whether this capability supports prediction resistance.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `true` for `https://developer.android.com/reference/kotlin/java/security/DrbgParameters.Capability#`, and `false` for `https://developer.android.com/reference/kotlin/java/security/DrbgParameters.Capability#` and `https://developer.android.com/reference/kotlin/java/security/DrbgParameters.Capability#` |

### supportsReseeding

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

```
fun supportsReseeding(): Boolean
```

Returns whether this capability supports reseeding.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `true` for `https://developer.android.com/reference/kotlin/java/security/DrbgParameters.Capability#` and `https://developer.android.com/reference/kotlin/java/security/DrbgParameters.Capability#`, and `false` for `https://developer.android.com/reference/kotlin/java/security/DrbgParameters.Capability#` |

### toString

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

```
fun toString(): String
```

Returns the name of this enum constant, as contained in the declaration. This method may be overridden, though it typically isn't necessary or desirable. An enum class should override this method when a more "programmer-friendly" string form exists.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | the name of this enum constant |