Stay organized with collections
Save and categorize content based on your preferences.
RSAPublicKeySpec
open class RSAPublicKeySpec : KeySpec
This class specifies an RSA public key.
Summary
Public constructors |
Creates a new RSAPublicKeySpec.
|
Creates a new RSAPublicKeySpec with additional key parameters.
|
Public constructors
RSAPublicKeySpec
RSAPublicKeySpec(
modulus: BigInteger!,
publicExponent: BigInteger!)
Creates a new RSAPublicKeySpec.
Public methods
getModulus
open fun getModulus(): BigInteger!
Returns the modulus.
getParams
open fun getParams(): AlgorithmParameterSpec!
Returns the parameters associated with this key, may be null if not present.
getPublicExponent
open fun getPublicExponent(): BigInteger!
Returns the public exponent.
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,["# RSAPublicKeySpec\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nRSAPublicKeySpec\n================\n\n```\nopen class RSAPublicKeySpec : KeySpec\n```\n\n|---|------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [java.security.spec.RSAPublicKeySpec](#) |\n\nThis class specifies an RSA public key.\n\nSummary\n-------\n\n| Public constructors ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [RSAPublicKeySpec](#RSAPublicKeySpec(java.math.BigInteger,%20java.math.BigInteger))`(`modulus:` `[BigInteger](../../math/BigInteger.html#)!`, `publicExponent:` `[BigInteger](../../math/BigInteger.html#)!`)` Creates a new RSAPublicKeySpec. |\n| [RSAPublicKeySpec](#RSAPublicKeySpec(java.math.BigInteger,%20java.math.BigInteger,%20java.security.spec.AlgorithmParameterSpec))`(`modulus:` `[BigInteger](../../math/BigInteger.html#)!`, `publicExponent:` `[BigInteger](../../math/BigInteger.html#)!`, `params:` `[AlgorithmParameterSpec](/reference/kotlin/java/security/spec/AlgorithmParameterSpec)!`)` Creates a new RSAPublicKeySpec with additional key parameters. |\n\n| Public methods ||\n|---------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------|\n| open [BigInteger](../../math/BigInteger.html#)! | [getModulus](#getModulus())`()` Returns the modulus. |\n| open [AlgorithmParameterSpec](/reference/kotlin/java/security/spec/AlgorithmParameterSpec)! | [getParams](#getParams())`()` Returns the parameters associated with this key, may be null if not present. |\n| open [BigInteger](../../math/BigInteger.html#)! | [getPublicExponent](#getPublicExponent())`()` Returns the public exponent. |\n\nPublic constructors\n-------------------\n\n### RSAPublicKeySpec\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nRSAPublicKeySpec(\n modulus: BigInteger!, \n publicExponent: BigInteger!)\n```\n\nCreates a new RSAPublicKeySpec.\n\n| Parameters ||\n|------------------|-----------------------------------------------------------------|\n| `modulus` | [BigInteger](../../math/BigInteger.html#)!: the modulus |\n| `publicExponent` | [BigInteger](../../math/BigInteger.html#)!: the public exponent |\n\n### RSAPublicKeySpec\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nRSAPublicKeySpec(\n modulus: BigInteger!, \n publicExponent: BigInteger!, \n params: AlgorithmParameterSpec!)\n```\n\nCreates a new RSAPublicKeySpec with additional key parameters.\n\n| Parameters ||\n|------------------|----------------------------------------------------------------------------------------------------------------------------------------------|\n| `modulus` | [BigInteger](../../math/BigInteger.html#)!: the modulus |\n| `publicExponent` | [BigInteger](../../math/BigInteger.html#)!: the public exponent |\n| `params` | [AlgorithmParameterSpec](/reference/kotlin/java/security/spec/AlgorithmParameterSpec)!: the parameters associated with this key, may be null |\n\nPublic methods\n--------------\n\n### getModulus\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getModulus(): BigInteger!\n```\n\nReturns the modulus.\n\n| Return ||\n|--------------------------------------------|-------------|\n| [BigInteger](../../math/BigInteger.html#)! | the modulus |\n\n### getParams\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getParams(): AlgorithmParameterSpec!\n```\n\nReturns the parameters associated with this key, may be null if not present.\n\n| Return ||\n|----------------------------------------------------------------------------------------|-----------------------------------------|\n| [AlgorithmParameterSpec](/reference/kotlin/java/security/spec/AlgorithmParameterSpec)! | the parameters associated with this key |\n\n### getPublicExponent\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getPublicExponent(): BigInteger!\n```\n\nReturns the public exponent.\n\n| Return ||\n|--------------------------------------------|---------------------|\n| [BigInteger](../../math/BigInteger.html#)! | the public exponent |"]]