Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

gnu.java.security.key.rsa
Class RSAKeyPairGenerator  view RSAKeyPairGenerator download RSAKeyPairGenerator.java

java.lang.Object
  extended bygnu.java.security.key.rsa.RSAKeyPairGenerator
All Implemented Interfaces:
gnu.java.security.key.IKeyPairGenerator

public class RSAKeyPairGenerator
extends java.lang.Object
implements gnu.java.security.key.IKeyPairGenerator

A key-pair generator for asymetric keys to use in conjunction with the RSA scheme.

Reference:

  1. RSA-PSS Signature Scheme with Appendix, part B. Primitive specification and supporting documentation. Jakob Jonsson and Burt Kaliski.
  2. Handbook of Applied Cryptography, Alfred J. Menezes, Paul C. van Oorschot and Scott A. Vanstone. Section 11.3 RSA and related signature schemes.


Field Summary
private static int DEFAULT_ENCODING_FORMAT
          Default encoding format to use when none was specified.
private static int DEFAULT_MODULUS_LENGTH
          Default value for the modulus length.
private  java.math.BigInteger e
          This implementation uses, by default, Fermat's F4 number as the public exponent.
private  int L
          The desired bit length of the modulus.
private static java.util.logging.Logger log
           
static java.lang.String MODULUS_LENGTH
          Property name of the length (Integer) of the modulus of an RSA key.
private static java.math.BigInteger ONE
          The BigInteger constant 1.
static java.lang.String PREFERRED_ENCODING_FORMAT
          Property name of the preferred encoding format to use when externalizing generated instance of key-pairs from this generator.
private  int preferredFormat
          Preferred encoding format of generated keys.
private  gnu.java.security.util.PRNG prng
          Our default source of randomness.
private  java.security.SecureRandom rnd
          The optional java.security.SecureRandom instance to use.
static java.lang.String RSA_PARAMETERS
          Property name of an optional java.security.spec.RSAKeyGenParameterSpec instance to use for this generator's n, and e values.
static java.lang.String SOURCE_OF_RANDOMNESS
          Property name of an optional java.security.SecureRandom instance to use.
private static java.math.BigInteger TWO
          The BigInteger constant 2.
 
Constructor Summary
RSAKeyPairGenerator()
           
 
Method Summary
 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.
private  gnu.java.security.util.PRNG getDefaultPRNG()
           
 java.lang.String name()
          Returns the canonical name of this keypair generator.
private  void nextRandomBytes(byte[] buffer)
          Fills the designated byte array with random data.
 void setup(java.util.Map attributes)
          Configures this instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final java.util.logging.Logger log

ONE

private static final java.math.BigInteger ONE
The BigInteger constant 1.


TWO

private static final java.math.BigInteger TWO
The BigInteger constant 2.


MODULUS_LENGTH

public static final java.lang.String MODULUS_LENGTH
Property name of the length (Integer) of the modulus of an RSA key.

See Also:
Constant Field Values

SOURCE_OF_RANDOMNESS

public static final java.lang.String SOURCE_OF_RANDOMNESS
Property name of an optional java.security.SecureRandom instance to use. The default is to use a classloader singleton from gnu.java.security.util.PRNG.

See Also:
Constant Field Values

RSA_PARAMETERS

public static final java.lang.String RSA_PARAMETERS
Property name of an optional java.security.spec.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).

See Also:
Constant Field Values

PREFERRED_ENCODING_FORMAT

public static final java.lang.String PREFERRED_ENCODING_FORMAT
Property name of the preferred encoding format to use when externalizing generated instance of key-pairs from this generator. The property is taken to be an java.lang.Integer that encapsulates an encoding format identifier.

See Also:
Constant Field Values

DEFAULT_MODULUS_LENGTH

private static final int DEFAULT_MODULUS_LENGTH
Default value for the modulus length.

See Also:
Constant Field Values

DEFAULT_ENCODING_FORMAT

private static final int DEFAULT_ENCODING_FORMAT
Default encoding format to use when none was specified.

See Also:
Constant Field Values

L

private int L
The desired bit length of the modulus.


e

private java.math.BigInteger e
This implementation uses, by default, Fermat's F4 number as the public exponent.


rnd

private java.security.SecureRandom rnd
The optional java.security.SecureRandom instance to use.


prng

private gnu.java.security.util.PRNG prng
Our default source of randomness.


preferredFormat

private int preferredFormat
Preferred encoding format of generated keys.

Constructor Detail

RSAKeyPairGenerator

public RSAKeyPairGenerator()
Method Detail

name

public java.lang.String name()
Description copied from interface: gnu.java.security.key.IKeyPairGenerator
Returns the canonical name of this keypair generator.

Specified by:
name in interface gnu.java.security.key.IKeyPairGenerator

setup

public void setup(java.util.Map attributes)

Configures this instance.

Specified by:
setup in interface gnu.java.security.key.IKeyPairGenerator

generate

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.

Specified by:
generate in interface gnu.java.security.key.IKeyPairGenerator

nextRandomBytes

private void nextRandomBytes(byte[] buffer)

Fills the designated byte array with random data.


getDefaultPRNG

private gnu.java.security.util.PRNG getDefaultPRNG()