Stay organized with collections
Save and categorize content based on your preferences.
DHPrivateKeySpec
open class DHPrivateKeySpec : KeySpec
This class specifies a Diffie-Hellman private key with its associated parameters.
Note that this class does not perform any validation on specified parameters. Thus, the specified values are returned directly even if they are null.
Summary
Public constructors |
Constructor that takes a private value x , a prime modulus p , and a base generator g .
|
Public methods |
open BigInteger! |
Returns the base generator g .
|
open BigInteger! |
Returns the prime modulus p .
|
open BigInteger! |
Returns the private value x .
|
Public constructors
DHPrivateKeySpec
DHPrivateKeySpec(
x: BigInteger!,
p: BigInteger!,
g: BigInteger!)
Constructor that takes a private value x
, a prime modulus p
, and a base generator g
.
Public methods
getG
open fun getG(): BigInteger!
Returns the base generator g
.
getP
open fun getP(): BigInteger!
Returns the prime modulus p
.
getX
open fun getX(): BigInteger!
Returns the private value x
.
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.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# DHPrivateKeySpec\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nDHPrivateKeySpec\n================\n\n```\nopen class DHPrivateKeySpec : KeySpec\n```\n\n|---|-----------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [javax.crypto.spec.DHPrivateKeySpec](#) |\n\nThis class specifies a Diffie-Hellman private key with its associated parameters.\n\nNote that this class does not perform any validation on specified parameters. Thus, the specified values are returned directly even if they are null.\n\nSummary\n-------\n\n| Public constructors ||\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [DHPrivateKeySpec](#DHPrivateKeySpec(java.math.BigInteger,%20java.math.BigInteger,%20java.math.BigInteger))`(`x:` `[BigInteger](../../../java/math/BigInteger.html#)!`, `p:` `[BigInteger](../../../java/math/BigInteger.html#)!`, `g:` `[BigInteger](../../../java/math/BigInteger.html#)!`)` Constructor that takes a private value `x`, a prime modulus `p`, and a base generator `g`. |\n\n| Public methods ||\n|---------------------------------------------------------|-----------------------------------------------------|\n| open [BigInteger](../../../java/math/BigInteger.html#)! | [getG](#getG())`()` Returns the base generator `g`. |\n| open [BigInteger](../../../java/math/BigInteger.html#)! | [getP](#getP())`()` Returns the prime modulus `p`. |\n| open [BigInteger](../../../java/math/BigInteger.html#)! | [getX](#getX())`()` Returns the private value `x`. |\n\nPublic constructors\n-------------------\n\n### DHPrivateKeySpec\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nDHPrivateKeySpec(\n x: BigInteger!, \n p: BigInteger!, \n g: BigInteger!)\n```\n\nConstructor that takes a private value `x`, a prime modulus `p`, and a base generator `g`.\n\n| Parameters ||\n|-----|----------------------------------------------------------------------|\n| `x` | [BigInteger](../../../java/math/BigInteger.html#)!: private value x |\n| `p` | [BigInteger](../../../java/math/BigInteger.html#)!: prime modulus p |\n| `g` | [BigInteger](../../../java/math/BigInteger.html#)!: base generator g |\n\nPublic methods\n--------------\n\n### getG\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getG(): BigInteger!\n```\n\nReturns the base generator `g`.\n\n| Return ||\n|----------------------------------------------------|------------------------|\n| [BigInteger](../../../java/math/BigInteger.html#)! | the base generator `g` |\n\n### getP\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getP(): BigInteger!\n```\n\nReturns the prime modulus `p`.\n\n| Return ||\n|----------------------------------------------------|-----------------------|\n| [BigInteger](../../../java/math/BigInteger.html#)! | the prime modulus `p` |\n\n### getX\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getX(): BigInteger!\n```\n\nReturns the private value `x`.\n\n| Return ||\n|----------------------------------------------------|-----------------------|\n| [BigInteger](../../../java/math/BigInteger.html#)! | the private value `x` |"]]