Stay organized with collections
Save and categorize content based on your preferences.
Capability
class Capability
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 RESEED_ONLY
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.
Capability requested = ...;
SecureRandom s = SecureRandom.getInstance("DRBG",
DrbgParameters(-1, requested, null));
Capability effective = ((DrbgParametes.Initiate) s.getParameters())
.getCapability();
requested and effective capabilities
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 |
Neither prediction resistance nor reseed.
|
Both prediction resistance and reseed.
|
Reseed but no prediction resistance.
|
Public methods |
Boolean |
Returns whether this capability supports prediction resistance.
|
Boolean |
Returns whether this capability supports reseeding.
|
String |
|
Enum values
Public methods
supportsPredictionResistance
fun supportsPredictionResistance(): Boolean
Returns whether this capability supports prediction resistance.
supportsReseeding
fun supportsReseeding(): Boolean
Returns whether this capability supports reseeding.
toString
fun toString(): String
Return |
String |
the name of this enum constant |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# DrbgParameters.Capability\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nCapability\n==========\n\n```\nclass Capability\n```\n\n|---|---|----------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) |||\n| ↳ | [kotlin.Enum](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html)\\\u003c[java.security.DrbgParameters.Capability](#)\\\u003e ||\n| | ↳ | [java.security.DrbgParameters.Capability](#) |\n\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [DrbgParameters.Capability.NONE](#ENUM_VALUE:NONE), [DrbgParameters.Capability.PR_AND_RESEED](#ENUM_VALUE:PR_AND_RESEED), [DrbgParameters.Capability.RESEED_ONLY](#ENUM_VALUE:RESEED_ONLY) |----------------------------------------------------------------------|-------------------------------------------| | [DrbgParameters.Capability.NONE](#ENUM_VALUE:NONE) | Neither prediction resistance nor reseed. | | [DrbgParameters.Capability.PR_AND_RESEED](#ENUM_VALUE:PR_AND_RESEED) | Both prediction resistance and reseed. | | [DrbgParameters.Capability.RESEED_ONLY](#ENUM_VALUE:RESEED_ONLY) | Reseed but no prediction resistance. | |\n\nThe reseedable and prediction resistance capabilities of a DRBG.\n\nWhen 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.\n\nPlease 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 [RESEED_ONLY](#) 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.\n\nThe table below lists possible effective values if a certain capability is requested, i.e. \n\n```kotlin\nCapability requested = ...;\n SecureRandom s = SecureRandom.getInstance(\"DRBG\",\n DrbgParameters(-1, requested, null));\n Capability effective = ((DrbgParametes.Initiate) s.getParameters())\n .getCapability();\n```\n\n| Requested Value | Possible Effective Values |\n| NONE | NONE, RESEED_ONLY, PR_AND_RESEED |\n| RESEED_ONLY | RESEED_ONLY, PR_AND_RESEED |\n| PR_AND_RESEED | PR_AND_RESEED |\n|-----------------|----------------------------------|\n\nA DRBG implementation supporting prediction resistance must also support reseeding.\n\nSummary\n-------\n\n| Enum values ||\n|-----------------------------------------------------------------------------------|---|\n| [NONE](#ENUM_VALUE:NONE) Neither prediction resistance nor reseed. |\n| [PR_AND_RESEED](#ENUM_VALUE:PR_AND_RESEED) Both prediction resistance and reseed. |\n| [RESEED_ONLY](#ENUM_VALUE:RESEED_ONLY) Reseed but no prediction resistance. |\n\n| Public methods ||\n|------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [supportsPredictionResistance](#supportsPredictionResistance())`()` Returns whether this capability supports prediction resistance. |\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [supportsReseeding](#supportsReseeding())`()` Returns whether this capability supports reseeding. |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [toString](#toString())`()` \u003cbr /\u003e |\n\nEnum values\n-----------\n\n### NONE\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val NONE : DrbgParameters.Capability\n```\n\nNeither prediction resistance nor reseed. \n\n### PR_AND_RESEED\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val PR_AND_RESEED : DrbgParameters.Capability\n```\n\nBoth prediction resistance and reseed. \n\n### RESEED_ONLY\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val RESEED_ONLY : DrbgParameters.Capability\n```\n\nReseed but no prediction resistance.\n\nPublic methods\n--------------\n\n### supportsPredictionResistance\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun supportsPredictionResistance(): Boolean\n```\n\nReturns whether this capability supports prediction resistance.\n\n| Return ||\n|------------------------------------------------------------------------------------|-------------------------------------------------------------------------------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `true` for [PR_AND_RESEED](#), and `false` for [RESEED_ONLY](#) and [NONE](#) |\n\n### supportsReseeding\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun supportsReseeding(): Boolean\n```\n\nReturns whether this capability supports reseeding.\n\n| Return ||\n|------------------------------------------------------------------------------------|-------------------------------------------------------------------------------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `true` for [PR_AND_RESEED](#) and [RESEED_ONLY](#), and `false` for [NONE](#) |\n\n### toString\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun toString(): String\n```\n\n| Return ||\n|----------------------------------------------------------------------------------|--------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | the name of this enum constant |"]]