Stay organized with collections
Save and categorize content based on your preferences.
RSAKey
public
interface
RSAKey
java.security.interfaces.RSAKey
|
Known indirect subclasses
|
The interface to a public or private key in
PKCS#1 v2.2 standard,
such as those for RSA, or RSASSA-PSS algorithms.
Summary
Public methods
getModulus
public abstract BigInteger getModulus ()
Returns the modulus.
getParams
public AlgorithmParameterSpec getParams ()
Returns the parameters associated with this key.
The parameters are optional and may be either
explicitly specified or implicitly created during
key pair generation.
Implementation Requirements:
- The default implementation returns
null
.
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,["# RSAKey\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Methods](#pubmethods) \n\nRSAKey\n======\n\n\n`\npublic\n\n\ninterface\nRSAKey\n`\n\n\n`\n\n\n`\n\n|---------------------------------|\n| java.security.interfaces.RSAKey |\n\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known indirect subclasses [RSAMultiPrimePrivateCrtKey](/reference/java/security/interfaces/RSAMultiPrimePrivateCrtKey), [RSAPrivateCrtKey](/reference/java/security/interfaces/RSAPrivateCrtKey), [RSAPrivateKey](/reference/java/security/interfaces/RSAPrivateKey), [RSAPublicKey](/reference/java/security/interfaces/RSAPublicKey) |----------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [RSAMultiPrimePrivateCrtKey](/reference/java/security/interfaces/RSAMultiPrimePrivateCrtKey) | The interface to 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. | | [RSAPrivateCrtKey](/reference/java/security/interfaces/RSAPrivateCrtKey) | The interface to 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. | | [RSAPrivateKey](/reference/java/security/interfaces/RSAPrivateKey) | The interface to an RSA private key. | | [RSAPublicKey](/reference/java/security/interfaces/RSAPublicKey) | The interface to an RSA public key. | |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nThe interface to a public or private key in\n[PKCS#1 v2.2](https://tools.ietf.org/rfc/rfc8017.txt) standard,\nsuch as those for RSA, or RSASSA-PSS algorithms. \n**See also:**\n\n- [RSAPublicKey](/reference/java/security/interfaces/RSAPublicKey)\n- [RSAPrivateKey](/reference/java/security/interfaces/RSAPrivateKey)\n\nSummary\n-------\n\n| ### Public methods ||\n|-------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract `[BigInteger](/reference/java/math/BigInteger) | ` `[getModulus](/reference/java/security/interfaces/RSAKey#getModulus())`() ` Returns the modulus. |\n| ` default `[AlgorithmParameterSpec](/reference/java/security/spec/AlgorithmParameterSpec) | ` `[getParams](/reference/java/security/interfaces/RSAKey#getParams())`() ` Returns the parameters associated with this key. |\n\nPublic methods\n--------------\n\n### getModulus\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract BigInteger getModulus ()\n```\n\nReturns the modulus.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-----------------------------------------------|--------------------|\n| [BigInteger](/reference/java/math/BigInteger) | the modulus \u003cbr /\u003e |\n\n### getParams\n\nAdded in [API level 35](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic AlgorithmParameterSpec getParams ()\n```\n\nReturns the parameters associated with this key.\nThe parameters are optional and may be either\nexplicitly specified or implicitly created during\nkey pair generation.\n\n\u003cbr /\u003e\n\n##### Implementation Requirements:\n\n- The default implementation returns `null`.\n\n| Returns ||\n|--------------------------------------------------------------------------------|-----------------------------------------------|\n| [AlgorithmParameterSpec](/reference/java/security/spec/AlgorithmParameterSpec) | the associated parameters, may be null \u003cbr /\u003e |"]]