public interface KeyPairGenRSA
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.
Modifier and Type | Method and Description |
---|---|
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.
|
void init(int key_size) throws Exception
key_size
- the number of bits of the key to be produced.Exception
byte[] getD()
d
.byte[] getE()
e
.byte[] getN()
byte[] getC()
byte[] getEP()
byte[] getEQ()
byte[] getP()
byte[] getQ()
This is an inofficial Javadoc created by PaĆlo Ebermann. Have a look at the official homepage.