com.jcraft.jsch
Interface KeyPairGenRSA


public interface KeyPairGenRSA

Usually not to be used by applications. A generator for an RSA key pair.

The library contains a default implementation of this class, based on the JCE classes available in Java SE from 1.4.

The actual implementation class is chosen by the configuration option "keypairgen.rsa", and then instantiated using the no-argument constructor. The library uses each instance only for one key generation.

This object creates a key pair consisting of a public key (e, N) and a private key (d, N), with e * d = 1 (mod φ(N)).

It also provides an alternative form of the private key (p, q, eP, eQ, c), with p, q primes, N = p * q, eP = d mod p-1, eQ = e mod q-1, and c * q = 1 mod p (i.e. c is an inverse of q modulo p). This form allows more efficient signing and decryption operations, using the Chinese Remainder Theorem.

See Also:
RSAPrivateCrtKey, RSAPublicKey, RFC 3447, Public-Key Cryptography Standards (PKCS) #1: RSA Cryptography Specifications Version 2.1, Section 3: Key types

Method Summary
 byte[] getC()
          The chinese remainder coefficient c, i.e. the inverse of q modulo p.
 byte[] getD()
          The decryption exponent d.
 byte[] getE()
          The encryption exponent e.
 byte[] getEP()
          The exponent to use modulo p.
 byte[] getEQ()
          The exponent to use modulo q.
 byte[] getN()
          The modulus of the key-pair.
 byte[] getP()
          The prime p.
 byte[] getQ()
          The prime q.
 void init(int key_size)
          Generates a new key pair.
 

Method Detail

init

void init(int key_size)
          throws Exception
Generates a new key pair. The other methods can then be called to retrieve the key components.

Parameters:
key_size - the number of bits of the key to be produced.
Throws:
Exception

getD

byte[] getD()
The decryption exponent d.


getE

byte[] getE()
The encryption exponent e.


getN

byte[] getN()
The modulus of the key-pair.


getC

byte[] getC()
The chinese remainder coefficient c, i.e. the inverse of q modulo p.


getEP

byte[] getEP()
The exponent to use modulo p.


getEQ

byte[] getEQ()
The exponent to use modulo q.


getP

byte[] getP()
The prime p.


getQ

byte[] getQ()
The prime q.



This is an inofficial Javadoc created by PaĆ­lo Ebermann. Have a look at the official homepage.