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

## cryptix.provider.rsa
Class RawRSAPrivateKey

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

public class RawRSAPrivateKey
extends BaseRSAPrivateKey

A class representing a RAW-encoded RSA private key.

The encoding consists of the following, in order:

1. the private exponent d,
2. the first factor of the modulus, p,
3. the second factor of the modulus, q,
4. the coefficient q^-1 mod p.

Each integer is represented as follows:

        Byte    Length
        offset  (bytes)   Meaning
        0       2         The length in bits of this BigInteger (MSB first);
        2       variable  The BigInteger's magnitude with no leading zeroes,
                          again MSB first.

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

$Revision: 1.7 $

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

Constructor Summary
`RawRSAPrivateKey(java.math.BigInteger n, java.math.BigInteger d)` Constructs a raw RSA private key given the private exponent, and the public modulus n.
`RawRSAPrivateKey(java.math.BigInteger d, java.math.BigInteger p, java.math.BigInteger q)` Constructs a raw RSA private key given the private exponent, and the two factors used to generate the public modulus n.
`RawRSAPrivateKey(java.math.BigInteger d, java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger u)` Constructs a raw RSA private key given the private exponent, and the two factors used to generate the public modulus n.
`RawRSAPrivateKey(java.io.InputStream is)` Constructs a raw RSA private key from data read from an InputStream, encoded as described above.

Method Summary
`byte[]` | `getEncoded()` Returns an encoding of the key as a byte array, as described above.
`java.lang.String` | `getFormat()` Returns the encoding format name, for this class always "RAW".

Methods inherited from class cryptix.provider.rsa.BaseRSAPrivateKey
`getAlgorithm, getExponent, getInverseOfQModP, getModulus, getP, getQ, setRsaParams, setRsaParams, toString`

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

Constructor Detail

### RawRSAPrivateKey

    public RawRSAPrivateKey(java.math.BigInteger n,
                            java.math.BigInteger d)

  Constructs a raw RSA private key given the private exponent, and the public modulus n. This should be used only when the factors of n are unknown.
  Parameters:
    `d` - the private exponent
    `n` - the public modulus

### RawRSAPrivateKey

    public RawRSAPrivateKey(java.math.BigInteger d,
                            java.math.BigInteger p,
                            java.math.BigInteger q)

  Constructs a raw RSA private key given the private exponent, and the two factors used to generate the public modulus n. The factors may be in any order.
  Parameters:
    `d` - the private exponent
    `p` - the first factor of the public modulus
    `q` - the second factor of the public modulus

### RawRSAPrivateKey

    public RawRSAPrivateKey(java.math.BigInteger d,
                            java.math.BigInteger p,
                            java.math.BigInteger q,
                            java.math.BigInteger u)

  Constructs a raw RSA private key given the private exponent, and the two factors used to generate the public modulus n. The factors must be given in the correct order, such that u = q^-1 mod p.
  Parameters:
    `d` - the private exponent
    `p` - the first factor of the public modulus
    `q` - the second factor of the public modulus
    `u` - the multiplicative inverse of q modulo p

### RawRSAPrivateKey

    public RawRSAPrivateKey(java.io.InputStream is)
                     throws java.io.IOException

  Constructs a raw RSA private key from data read from an InputStream, encoded as described above.
  Parameters:
    `is` - the input stream from which data is parsed.
  Throws:
    java.io.IOException - if any I/O error occurs.
  See Also:
    `getEncoded()`

Method Detail

### getFormat

    public java.lang.String getFormat()

  Returns the encoding format name, for this class always "RAW".
  Returns:
    the encoding format name for this key, "RAW".

### getEncoded

    public byte[] getEncoded()

  Returns an encoding of the key as a byte array, as described above.
  Returns:
    the encoded byte array, or null if an error occurred.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Cryptix V3.2
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.