All Packages Class Hierarchy This Package Previous Next Index
It is not specified which factor is the larger, but the coefficient must be equal to the inverse of q modulo p.
Note that if the encryption exponent e, and the two factors are available to an attacker, the decryption exponent d can be found. This means that the factors must always be kept secret.
The intention is for implementations of RSAPrivateKey (and possibly
RSAPublicKey) to optionally implement this interface. Users of RSA keys can
check whether the key object is an instanceof RSAFactors
,
and if so make a further check that the factors are known for this key
(i.e. that getP
, getQ
and
getInverseOfQModP
return non-null values).
For example:
import java.security.interfaces.*;
void foo(RSAPrivateKey key) { BigInteger p = null, q = null, u = null;
if (key instanceof RSAFactors) { RSAFactors factors = (RSAFactors) key; p = factors.getP(); q = factors.getQ(); u = factors.getInverseOfQModP(); } if (p != null) { // efficient code (q and u can be assumed to be non-null) } else { // less efficient code } }
Key implementations should ensure that either all of the methods defined in this interface return null, or that none of them do.
This interface is not supported in JavaSoft's version of JCE.. To maintain compatibility, the RSAFactors classfile should be included with any application that uses it and may be linked against JavaSoft's JCE, so that the application will not fail with a NoClassDefFoundError.
Copyright © 1997
Systemics Ltd on behalf of the
Cryptix Development Team.
All rights reserved.
$Revision: 1.1.1.1 $
public abstract BigInteger getP()
public abstract BigInteger getQ()
public abstract BigInteger getInverseOfQModP()
All Packages Class Hierarchy This Package Previous Next Index