Skip to main content

Find RSA key generation parameters

io.moderne.cryptography.FindRSAKeyGenParameters

Finds RSAKeyGenParameterSpec instantiations and extracts their parameter values into a data table.

Recipe source

This recipe is only available to users of Moderne.

This recipe is available under the Moderne Proprietary License.

Example

Before
import java.security.spec.RSAKeyGenParameterSpec;

public class RSAKeyExample {
public void generateKey() {
// Basic RSA key generation with 2048 bits and F4 exponent
RSAKeyGenParameterSpec spec = new RSAKeyGenParameterSpec(2048,
RSAKeyGenParameterSpec.F4);
}
}
After
import java.security.spec.RSAKeyGenParameterSpec;

public class RSAKeyExample {
public void generateKey() {
// Basic RSA key generation with 2048 bits and F4 exponent
RSAKeyGenParameterSpec spec = /*~~>*/new RSAKeyGenParameterSpec(2048,
RSAKeyGenParameterSpec.F4);
}
}

Usage

This recipe has no required configuration options. Users of Moderne can run it via the Moderne CLI:

You will need to have configured the Moderne CLI on your machine before you can run the following command.

shell
mod run . --recipe FindRSAKeyGenParameters

If the recipe is not available locally, then you can install it using:

mod config recipes jar install io.moderne.recipe:rewrite-cryptography:0.11.2

See how this recipe works across multiple open-source repositories

Run this recipe on OSS repos at scale with the Moderne SaaS.

The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories.

Please contact Moderne for more information about safely running the recipes on your own codebase in a private SaaS.

Data Tables

RSA key generation parameters

io.moderne.cryptography.table.RSAKeyGenParametersTable

RSAKeyGenParameterSpec instantiations and their configured parameters including key size, public exponent, and optional parameters.

Column NameDescription
Source fileThe source file containing the RSAKeyGenParameterSpec instantiation
Line numberThe line number where the RSAKeyGenParameterSpec is instantiated
Object typeThe type of key generation parameter object (e.g., RSAKeyGenParameterSpec)
Key sizeThe RSA key size in bits
Public exponentThe public exponent value (e.g., F4, 65537)
Key parametersAdditional key generation parameters if specified