public class RSAKeyPairGenerator extends java.lang.Object implements IKeyPairGenerator
A key-pair generator for asymetric keys to use in conjunction with the RSA scheme.
Reference:
Modifier and Type | Class and Description |
---|---|
static class |
RSAKeyPairGenerator.PRIMEMOD |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MODULUS_LENGTH
Property name of the length (Integer) of the modulus of an RSA key.
|
static java.lang.String |
PRIME_GENERATION_PARAMETER |
static java.lang.String |
RSA_PARAMETERS
Property name of an optional
RSAKeyGenParameterSpec instance to
use for this generator's n , and e values. |
static java.lang.String |
SOURCE_OF_RANDOMNESS
Property name of an optional
SecureRandom instance to use. |
Constructor and Description |
---|
RSAKeyPairGenerator() |
Modifier and Type | Method and Description |
---|---|
java.security.KeyPair |
generate()
The algorithm used here is described in nessie-pss-B.pdf
document which is part of the RSA-PSS submission to NESSIE.
|
java.lang.String |
name()
Returns the canonical name of this keypair generator.
|
void |
setup(java.util.Map attributes)
Configures this instance.
|
public static final java.lang.String MODULUS_LENGTH
public static final java.lang.String SOURCE_OF_RANDOMNESS
SecureRandom
instance to use. The
default is to use a classloader singleton from PRNG
.public static final java.lang.String RSA_PARAMETERS
RSAKeyGenParameterSpec
instance to
use for this generator's n
, and e
values. The
default is to generate n
and use a fixed value for
e
(Fermat's F4 number).public static final java.lang.String PRIME_GENERATION_PARAMETER
public java.lang.String name()
IKeyPairGenerator
name
in interface IKeyPairGenerator
public void setup(java.util.Map attributes)
Configures this instance.
setup
in interface IKeyPairGenerator
attributes
- the map of name/value pairs to use.java.lang.IllegalArgumentException
- if the designated MODULUS_LENGTH
value is less than 1024.public java.security.KeyPair generate()
The algorithm used here is described in nessie-pss-B.pdf document which is part of the RSA-PSS submission to NESSIE.
generate
in interface IKeyPairGenerator
Copyright © 2025. All rights reserved.