Stay organized with collections
Save and categorize content based on your preferences.
RSAPrivateKeySpec
open class RSAPrivateKeySpec : KeySpec
Known Direct Subclasses
RSAMultiPrimePrivateCrtKeySpec |
This class specifies an RSA multi-prime private key, as defined in the PKCS#1 v2.2 standard using the Chinese Remainder Theorem (CRT) information values for efficiency.
|
RSAPrivateCrtKeySpec |
This class specifies an RSA private key, as defined in the PKCS#1 v2.2 standard, using the Chinese Remainder Theorem (CRT) information values for efficiency.
|
|
This class specifies an RSA private key.
Summary
Public constructors |
Creates a new RSAPrivateKeySpec.
|
Creates a new RSAPrivateKeySpec with additional key parameters.
|
Public constructors
RSAPrivateKeySpec
RSAPrivateKeySpec(
modulus: BigInteger!,
privateExponent: BigInteger!)
Creates a new RSAPrivateKeySpec.
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.
getPrivateExponent
open fun getPrivateExponent(): BigInteger!
Returns the private 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,["# RSAPrivateKeySpec\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nRSAPrivateKeySpec\n=================\n\n```\nopen class RSAPrivateKeySpec : KeySpec\n```\n\n|---|-------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [java.security.spec.RSAPrivateKeySpec](#) |\n\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [RSAMultiPrimePrivateCrtKeySpec](/reference/kotlin/java/security/spec/RSAMultiPrimePrivateCrtKeySpec), [RSAPrivateCrtKeySpec](/reference/kotlin/java/security/spec/RSAPrivateCrtKeySpec) |-------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [RSAMultiPrimePrivateCrtKeySpec](/reference/kotlin/java/security/spec/RSAMultiPrimePrivateCrtKeySpec) | This class specifies an RSA multi-prime private key, as defined in the [PKCS#1 v2.2](https://tools.ietf.org/rfc/rfc8017.txt) standard using the Chinese Remainder Theorem (CRT) information values for efficiency. | | [RSAPrivateCrtKeySpec](/reference/kotlin/java/security/spec/RSAPrivateCrtKeySpec) | This class specifies an RSA private key, as defined in the [PKCS#1 v2.2](https://tools.ietf.org/rfc/rfc8017.txt) standard, using the Chinese Remainder Theorem (CRT) information values for efficiency. | |\n\nThis class specifies an RSA private key.\n\nSummary\n-------\n\n| Public constructors ||\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [RSAPrivateKeySpec](#RSAPrivateKeySpec(java.math.BigInteger,%20java.math.BigInteger))`(`modulus:` `[BigInteger](../../math/BigInteger.html#)!`, `privateExponent:` `[BigInteger](../../math/BigInteger.html#)!`)` Creates a new RSAPrivateKeySpec. |\n| [RSAPrivateKeySpec](#RSAPrivateKeySpec(java.math.BigInteger,%20java.math.BigInteger,%20java.security.spec.AlgorithmParameterSpec))`(`modulus:` `[BigInteger](../../math/BigInteger.html#)!`, `privateExponent:` `[BigInteger](../../math/BigInteger.html#)!`, `params:` `[AlgorithmParameterSpec](/reference/kotlin/java/security/spec/AlgorithmParameterSpec)!`)` Creates a new RSAPrivateKeySpec 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#)! | [getPrivateExponent](#getPrivateExponent())`()` Returns the private exponent. |\n\nPublic constructors\n-------------------\n\n### RSAPrivateKeySpec\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nRSAPrivateKeySpec(\n modulus: BigInteger!, \n privateExponent: BigInteger!)\n```\n\nCreates a new RSAPrivateKeySpec.\n\n| Parameters ||\n|-------------------|------------------------------------------------------------------|\n| `modulus` | [BigInteger](../../math/BigInteger.html#)!: the modulus |\n| `privateExponent` | [BigInteger](../../math/BigInteger.html#)!: the private exponent |\n\n### RSAPrivateKeySpec\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nRSAPrivateKeySpec(\n modulus: BigInteger!, \n privateExponent: BigInteger!, \n params: AlgorithmParameterSpec!)\n```\n\nCreates a new RSAPrivateKeySpec with additional key parameters.\n\n| Parameters ||\n|-------------------|----------------------------------------------------------------------------------------------------------------------------------------------|\n| `modulus` | [BigInteger](../../math/BigInteger.html#)!: the modulus |\n| `privateExponent` | [BigInteger](../../math/BigInteger.html#)!: the private 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### getPrivateExponent\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getPrivateExponent(): BigInteger!\n```\n\nReturns the private exponent.\n\n| Return ||\n|--------------------------------------------|----------------------|\n| [BigInteger](../../math/BigInteger.html#)! | the private exponent |"]]