Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Cryptix V3.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## cryptix.provider.rsa
Class BaseRSAPrivateKey

    java.lang.Object
      |
      +--cryptix.provider.rsa.BaseRSAPrivateKey

Direct Known Subclasses:
  RawRSAPrivateKey

public abstract class BaseRSAPrivateKey
extends Object
implements CryptixRSAPrivateKey, RSAFactors

An abstract class representing an RSA private key.

Copyright © 1997 Systemics Ltd on behalf of the Cryptix Development Team.
All rights reserved.

$Revision: 1.6 $

Since:
  Cryptix 2.2.2
Author:
  Raif S. Naffah, David Hopwood
See Also:
  Serialized Form

Fields inherited from interface java.security.PrivateKey
`serialVersionUID`

Fields inherited from interface java.security.Key
`serialVersionUID`

Constructor Summary
`protected` | `BaseRSAPrivateKey()` Constructs an RSA private key, without setting the parameters.

Method Summary
`String` | `getAlgorithm()` Returns the name of the algorithm, for this class always "RSA".
`java.math.BigInteger` | `getExponent()` Return the private exponent d.
`java.math.BigInteger` | `getInverseOfQModP()` Returns the multiplicative inverse of q modulo p.
`java.math.BigInteger` | `getModulus()` Return the public modulus n: the product of both p and q.
`java.math.BigInteger` | `getP()` Returns p, the first factor of the public modulus.
`java.math.BigInteger` | `getQ()` Return q, the second factor of the public modulus.
`protected void` | `setRsaParams(java.math.BigInteger n, java.math.BigInteger d)` Sets the RSA parameters n and d.
`protected void` | `setRsaParams(java.math.BigInteger d, java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger u)` Sets the RSA parameters d, p, q, and u, to allow fast execution of mathematical operations performed later on during the life of this key.
`String` | `toString()` Returns a string representation of this key.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### BaseRSAPrivateKey

    protected BaseRSAPrivateKey()

  Constructs an RSA private key, without setting the parameters. Subclasses should call one of the setRsaParams methods in each of their constructors.

Method Detail

### getModulus

    public java.math.BigInteger getModulus()

  Return the public modulus n: the product of both p and q.
  Returns:
    the public modulus n: the product of both p and q.

### getExponent

    public java.math.BigInteger getExponent()

  Return the private exponent d.
  Returns:
    the private exponent d.

### getP

    public java.math.BigInteger getP()

  Returns p, the first factor of the public modulus.
  Specified by:
    getP in interface RSAFactors
  Returns:
    the first factor p

### getQ

    public java.math.BigInteger getQ()

  Return q, the second factor of the public modulus.
  Specified by:
    getQ in interface RSAFactors
  Returns:
    the second factor q

### getInverseOfQModP

    public java.math.BigInteger getInverseOfQModP()

  Returns the multiplicative inverse of q modulo p. The values p and q are those returned by the getP() and getQ() methods respectively.
  Specified by:
    getInverseOfQModP in interface RSAFactors
  Returns:
    the multiplicative inverse of q modulo p.

### getAlgorithm

    public String getAlgorithm()

  Returns the name of the algorithm, for this class always "RSA".
  Returns:
    the name of the algorithm, "RSA".

### setRsaParams

    protected void setRsaParams(java.math.BigInteger n,
                                java.math.BigInteger d)

  Sets the RSA parameters n and d.
  Throws:
    NullPointerException - if n == null || d == null

### setRsaParams

    protected void setRsaParams(java.math.BigInteger d,
                                java.math.BigInteger p,
                                java.math.BigInteger q,
                                java.math.BigInteger u)

  Sets the RSA parameters d, p, q, and u, to allow fast execution of mathematical operations performed later on during the life of this key. u may be null, in which case it is calculated automatically.
  Throws:
    NullPointerException - if d == null || p == null || q == null
    InvalidParameterException - if u must be calculated, and gcd(q, p) != 1

### toString

    public String toString()

  Returns a string representation of this key. This may reveal private information when debugging is enabled, and should be used with care.
  Overrides:
    toString in class Object
  Returns:
    a string representation of this key.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Cryptix V3.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (C) 1995-2000 The Cryptix Foundation Ltd. All rights reserved.