Stay organized with collections
Save and categorize content based on your preferences.
DHPublicKeySpec
open class DHPublicKeySpec : KeySpec
This class specifies a Diffie-Hellman public 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 public value y , 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 public value y .
|
Public constructors
DHPublicKeySpec
DHPublicKeySpec(
y: BigInteger!,
p: BigInteger!,
g: BigInteger!)
Constructor that takes a public value y
, 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
.
getY
open fun getY(): BigInteger!
Returns the public value y
.
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,["# DHPublicKeySpec\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nDHPublicKeySpec\n===============\n\n```\nopen class DHPublicKeySpec : KeySpec\n```\n\n|---|----------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [javax.crypto.spec.DHPublicKeySpec](#) |\n\nThis class specifies a Diffie-Hellman public 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| [DHPublicKeySpec](#DHPublicKeySpec(java.math.BigInteger,%20java.math.BigInteger,%20java.math.BigInteger))`(`y:` `[BigInteger](../../../java/math/BigInteger.html#)!`, `p:` `[BigInteger](../../../java/math/BigInteger.html#)!`, `g:` `[BigInteger](../../../java/math/BigInteger.html#)!`)` Constructor that takes a public value `y`, 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#)! | [getY](#getY())`()` Returns the public value `y`. |\n\nPublic constructors\n-------------------\n\n### DHPublicKeySpec\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nDHPublicKeySpec(\n y: BigInteger!, \n p: BigInteger!, \n g: BigInteger!)\n```\n\nConstructor that takes a public value `y`, a prime modulus `p`, and a base generator `g`.\n\n| Parameters ||\n|-----|----------------------------------------------------------------------|\n| `y` | [BigInteger](../../../java/math/BigInteger.html#)!: public value y |\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### getY\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getY(): BigInteger!\n```\n\nReturns the public value `y`.\n\n| Return ||\n|----------------------------------------------------|----------------------|\n| [BigInteger](../../../java/math/BigInteger.html#)! | the public value `y` |"]]