de.flexiprovider.core.rsa
Class RSAKeyGenParameterSpec

java.lang.Object
  |
  +--java.security.spec.RSAKeyGenParameterSpec
        |
        +--de.flexiprovider.core.rsa.RSAKeyGenParameterSpec
All Implemented Interfaces:
AlgorithmParameterSpec, java.security.spec.AlgorithmParameterSpec
Direct Known Subclasses:
MeRSAKeyGenParameterSpec, MpRSAKeyGenParameterSpec

public class RSAKeyGenParameterSpec
extends java.security.spec.RSAKeyGenParameterSpec
implements AlgorithmParameterSpec

This class specifies parameters used by the RSAKeyPairGenerator.

Author:
Martin Döring

Field Summary
static FlexiBigInt DEFAULT_EXPONENT
          The default public exponent (216+1)
static int DEFAULT_KEY_SIZE
          The default key size (1024 bits)
 
Fields inherited from class java.security.spec.RSAKeyGenParameterSpec
F0, F4
 
Constructor Summary
RSAKeyGenParameterSpec()
          Construct the default RSA key generation parameters.
RSAKeyGenParameterSpec(int keySize)
          Construct new RSA key generation parameters from the given key size.
RSAKeyGenParameterSpec(int keySize, FlexiBigInt e)
          Construct new RSA key generation parameters from the given key size and public exponent.
 
Method Summary
 FlexiBigInt getE()
          Return the public exponent.
 int getKeySize()
          Return the key size in bits.
 
Methods inherited from class java.security.spec.RSAKeyGenParameterSpec
, getKeysize, getPublicExponent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_KEY_SIZE

public static final int DEFAULT_KEY_SIZE
The default key size (1024 bits)

DEFAULT_EXPONENT

public static final FlexiBigInt DEFAULT_EXPONENT
The default public exponent (216+1)
Constructor Detail

RSAKeyGenParameterSpec

public RSAKeyGenParameterSpec()
Construct the default RSA key generation parameters. The key size is set to the DEFAULT_KEY_SIZE, the public exponent is set to the DEFAULT_EXPONENT.

RSAKeyGenParameterSpec

public RSAKeyGenParameterSpec(int keySize)
Construct new RSA key generation parameters from the given key size. The public exponent is set to the DEFAULT_EXPONENT. If the key size is invalid, choose the DEFAULT_KEY_SIZE.
Parameters:
keySize - the key size (>= 512 bits)

RSAKeyGenParameterSpec

public RSAKeyGenParameterSpec(int keySize,
                              FlexiBigInt e)
Construct new RSA key generation parameters from the given key size and public exponent. If the key size is invalid, choose the DEFAULT_KEY_SIZE. If the public exponent is invalid, choose the DEFAULT_EXPONENT.
Parameters:
keySize - the key size (>= 512 bits)
e - the public exponent (must be odd)
Method Detail

getKeySize

public int getKeySize()
Return the key size in bits. If the key size is < 512, return the default key size.
Returns:
the key size in bits

getE

public FlexiBigInt getE()
Return the public exponent. If the public exponent is even, return the default exponent.
Returns:
the public exponent