Stay organized with collections
Save and categorize content based on your preferences.
ECParameterSpec
open class ECParameterSpec : AlgorithmParameterSpec
This immutable class specifies the set of domain parameters used with elliptic curve cryptography (ECC).
Summary
Public constructors |
Creates elliptic curve domain parameters based on the specified values.
|
Public methods |
open Int |
Returns the cofactor.
|
open EllipticCurve! |
Returns the elliptic curve that this parameter defines.
|
open ECPoint! |
Returns the generator which is also known as the base point.
|
open BigInteger! |
Returns the order of the generator.
|
Public constructors
ECParameterSpec
ECParameterSpec(
curve: EllipticCurve!,
g: ECPoint!,
n: BigInteger!,
h: Int)
Creates elliptic curve domain parameters based on the specified values.
Parameters |
curve |
EllipticCurve!: the elliptic curve which this parameter defines. |
g |
ECPoint!: the generator which is also known as the base point. |
n |
BigInteger!: the order of the generator g . |
h |
Int: the cofactor. |
Exceptions |
java.lang.NullPointerException |
if curve , g , or n is null. |
java.lang.IllegalArgumentException |
if n or h is not positive. |
Public methods
getCofactor
open fun getCofactor(): Int
Returns the cofactor.
getCurve
open fun getCurve(): EllipticCurve!
Returns the elliptic curve that this parameter defines.
Return |
EllipticCurve! |
the elliptic curve that this parameter defines. |
getGenerator
open fun getGenerator(): ECPoint!
Returns the generator which is also known as the base point.
Return |
ECPoint! |
the generator which is also known as the base point. |
getOrder
open fun getOrder(): BigInteger!
Returns the order of the generator.
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,["# ECParameterSpec\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nECParameterSpec\n===============\n\n```\nopen class ECParameterSpec : AlgorithmParameterSpec\n```\n\n|---|-----------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [java.security.spec.ECParameterSpec](#) |\n\nThis immutable class specifies the set of domain parameters used with elliptic curve cryptography (ECC).\n\nSummary\n-------\n\n| Public constructors ||\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [ECParameterSpec](#ECParameterSpec(java.security.spec.EllipticCurve,%20java.security.spec.ECPoint,%20java.math.BigInteger,%20kotlin.Int))`(`curve:` `[EllipticCurve](/reference/kotlin/java/security/spec/EllipticCurve)!`, `g:` `[ECPoint](/reference/kotlin/java/security/spec/ECPoint)!`, `n:` `[BigInteger](../../math/BigInteger.html#)!`, `h:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Creates elliptic curve domain parameters based on the specified values. |\n\n| Public methods ||\n|---------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------|\n| open [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getCofactor](#getCofactor())`()` Returns the cofactor. |\n| open [EllipticCurve](/reference/kotlin/java/security/spec/EllipticCurve)! | [getCurve](#getCurve())`()` Returns the elliptic curve that this parameter defines. |\n| open [ECPoint](/reference/kotlin/java/security/spec/ECPoint)! | [getGenerator](#getGenerator())`()` Returns the generator which is also known as the base point. |\n| open [BigInteger](../../math/BigInteger.html#)! | [getOrder](#getOrder())`()` Returns the order of the generator. |\n\nPublic constructors\n-------------------\n\n### ECParameterSpec\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nECParameterSpec(\n curve: EllipticCurve!, \n g: ECPoint!, \n n: BigInteger!, \n h: Int)\n```\n\nCreates elliptic curve domain parameters based on the specified values.\n\n| Parameters ||\n|---------|------------------------------------------------------------------------------------------------------------------------|\n| `curve` | [EllipticCurve](/reference/kotlin/java/security/spec/EllipticCurve)!: the elliptic curve which this parameter defines. |\n| `g` | [ECPoint](/reference/kotlin/java/security/spec/ECPoint)!: the generator which is also known as the base point. |\n| `n` | [BigInteger](../../math/BigInteger.html#)!: the order of the generator `g`. |\n| `h` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): the cofactor. |\n\n| Exceptions ||\n|--------------------------------------|----------------------------------|\n| `java.lang.NullPointerException` | if `curve`, `g`, or `n` is null. |\n| `java.lang.IllegalArgumentException` | if `n` or `h` is not positive. |\n\nPublic methods\n--------------\n\n### getCofactor\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getCofactor(): Int\n```\n\nReturns the cofactor.\n\n| Return ||\n|----------------------------------------------------------------------------|---------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | the cofactor. |\n\n### getCurve\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getCurve(): EllipticCurve!\n```\n\nReturns the elliptic curve that this parameter defines.\n\n| Return ||\n|----------------------------------------------------------------------|-------------------------------------------------|\n| [EllipticCurve](/reference/kotlin/java/security/spec/EllipticCurve)! | the elliptic curve that this parameter defines. |\n\n### getGenerator\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getGenerator(): ECPoint!\n```\n\nReturns the generator which is also known as the base point.\n\n| Return ||\n|----------------------------------------------------------|------------------------------------------------------|\n| [ECPoint](/reference/kotlin/java/security/spec/ECPoint)! | the generator which is also known as the base point. |\n\n### getOrder\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getOrder(): BigInteger!\n```\n\nReturns the order of the generator.\n\n| Return ||\n|--------------------------------------------|-----------------------------|\n| [BigInteger](../../math/BigInteger.html#)! | the order of the generator. |"]]