Stay organized with collections
Save and categorize content based on your preferences.
DHGenParameterSpec
open class DHGenParameterSpec : AlgorithmParameterSpec
This class specifies the set of parameters used for generating Diffie-Hellman (system) parameters for use in Diffie-Hellman key agreement. This is typically done by a central authority.
The central authority, after computing the parameters, must send this information to the parties looking to agree on a secret key.
Summary
Public constructors |
Constructs a parameter set for the generation of Diffie-Hellman (system) parameters.
|
Public methods |
open Int |
Returns the size in bits of the random exponent (private value).
|
open Int |
Returns the size in bits of the prime modulus.
|
Public constructors
DHGenParameterSpec
DHGenParameterSpec(
primeSize: Int,
exponentSize: Int)
Constructs a parameter set for the generation of Diffie-Hellman (system) parameters. The constructed parameter set can be used to initialize an AlgorithmParameterGenerator
object for the generation of Diffie-Hellman parameters.
Parameters |
primeSize |
Int: the size (in bits) of the prime modulus. |
exponentSize |
Int: the size (in bits) of the random exponent. |
Public methods
getExponentSize
open fun getExponentSize(): Int
Returns the size in bits of the random exponent (private value).
Return |
Int |
the size in bits of the random exponent (private value) |
getPrimeSize
open fun getPrimeSize(): Int
Returns the size in bits of the prime modulus.
Return |
Int |
the size in bits of the prime modulus |
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,["# DHGenParameterSpec\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nDHGenParameterSpec\n==================\n\n```\nopen class DHGenParameterSpec : AlgorithmParameterSpec\n```\n\n|---|-------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [javax.crypto.spec.DHGenParameterSpec](#) |\n\nThis class specifies the set of parameters used for generating Diffie-Hellman (system) parameters for use in Diffie-Hellman key agreement. This is typically done by a central authority.\n\nThe central authority, after computing the parameters, must send this information to the parties looking to agree on a secret key.\n\nSummary\n-------\n\n| Public constructors ||\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [DHGenParameterSpec](#DHGenParameterSpec(kotlin.Int,%20kotlin.Int))`(`primeSize:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `exponentSize:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Constructs a parameter set for the generation of Diffie-Hellman (system) parameters. |\n\n| Public methods ||\n|---------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------|\n| open [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getExponentSize](#getExponentSize())`()` Returns the size in bits of the random exponent (private value). |\n| open [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getPrimeSize](#getPrimeSize())`()` Returns the size in bits of the prime modulus. |\n\nPublic constructors\n-------------------\n\n### DHGenParameterSpec\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nDHGenParameterSpec(\n primeSize: Int, \n exponentSize: Int)\n```\n\nConstructs a parameter set for the generation of Diffie-Hellman (system) parameters. The constructed parameter set can be used to initialize an [AlgorithmParameterGenerator](../../../java/security/AlgorithmParameterGenerator.html#) object for the generation of Diffie-Hellman parameters.\n\n| Parameters ||\n|----------------|------------------------------------------------------------------------------------------------------------------------|\n| `primeSize` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): the size (in bits) of the prime modulus. |\n| `exponentSize` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): the size (in bits) of the random exponent. |\n\nPublic methods\n--------------\n\n### getExponentSize\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getExponentSize(): Int\n```\n\nReturns the size in bits of the random exponent (private value).\n\n| Return ||\n|----------------------------------------------------------------------------|---------------------------------------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | the size in bits of the random exponent (private value) |\n\n### getPrimeSize\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getPrimeSize(): Int\n```\n\nReturns the size in bits of the prime modulus.\n\n| Return ||\n|----------------------------------------------------------------------------|---------------------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | the size in bits of the prime modulus |"]]