Overview | Package | Class | Tree | Deprecated | Index | Help
| For the latest news and information visit The GNU Crypto project
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## gnu.crypto.sig.rsa
Class GnuRSAPrivateKey

    java.lang.Object
      |
      +--gnu.crypto.sig.rsa.GnuRSAKey
            |
            +--gnu.crypto.sig.rsa.GnuRSAPrivateKey

All Implemented Interfaces:
  java.security.Key, java.security.PrivateKey, java.security.interfaces.RSAKey, java.security.interfaces.RSAPrivateCrtKey, java.security.interfaces.RSAPrivateKey, java.io.Serializable

public class GnuRSAPrivateKey
extends GnuRSAKey
implements java.security.PrivateKey, java.security.interfaces.RSAPrivateCrtKey

An object that embodies an RSA private key.

References:

1. RSA-PSS Signature Scheme with Appendix, part B.
   Primitive specification and supporting documentation.
   Jakob Jonsson and Burt Kaliski.

Version:
  $Revision: 1.2 $
See Also:
  Serialized Form

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

Constructor Summary
`GnuRSAPrivateKey(java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger e, java.math.BigInteger d)` Trivial constructor.

Method Summary
`boolean` | `equals(java.lang.Object obj)` Returns `true` if the designated object is an instance of this class and has the same DSS (Digital Signature Standard) parameter values as this one.
`java.math.BigInteger` | `getCrtCoefficient()`
`byte[]` | `getEncoded()` Deprecated. see getEncoded(int).
`byte[]` | `getEncoded(int format)` Returns the encoded form of this private key according to the designated format.
`java.math.BigInteger` | `getPrimeExponentP()`
`java.math.BigInteger` | `getPrimeExponentQ()`
`java.math.BigInteger` | `getPrimeP()`
`java.math.BigInteger` | `getPrimeQ()`
`java.math.BigInteger` | `getPrivateExponent()`
`java.math.BigInteger` | `getPublicExponent()`
`static GnuRSAPrivateKey` | `valueOf(byte[] k)` A class method that takes the output of the `encodePrivateKey()` method of a DSS keypair codec object (an instance implementing `IKeyPairCodec` for DSS keys, and re-constructs an instance of this object.

Methods inherited from class gnu.crypto.sig.rsa.GnuRSAKey
`getAlgorithm, getFormat, getModulus, getN`

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

Methods inherited from interface java.security.Key
`getAlgorithm, getFormat`

Methods inherited from interface java.security.interfaces.RSAKey
`getModulus`

Constructor Detail

### GnuRSAPrivateKey

    public GnuRSAPrivateKey(java.math.BigInteger p,
                            java.math.BigInteger q,
                            java.math.BigInteger e,
                            java.math.BigInteger d)

  Trivial constructor.

  Parameters:
    `p` - the modulus first prime divisor.
    `p` - the modulus second prime divisor.
    `e` - the public exponent.
    `d` - the private exponent.

Method Detail

### valueOf

    public static GnuRSAPrivateKey valueOf(byte[] k)

  A class method that takes the output of the `encodePrivateKey()` method of a DSS keypair codec object (an instance implementing `IKeyPairCodec` for DSS keys, and re-constructs an instance of this object.

  Parameters:
    `k` - the contents of a previously encoded instance of this object.
  Throws:
    `ArrayIndexOutOfBoundsException` - if there is not enough bytes, in `k`, to represent a valid encoding of an instance of this object.
    `java.lang.IllegalArgumentException` - if the byte sequence does not represent a valid encoding of an instance of this object.

### getPublicExponent

    public java.math.BigInteger getPublicExponent()

  Specified by:
    `getPublicExponent` in interface `java.security.interfaces.RSAPrivateCrtKey`

### getPrimeP

    public java.math.BigInteger getPrimeP()

  Specified by:
    `getPrimeP` in interface `java.security.interfaces.RSAPrivateCrtKey`

### getPrimeQ

    public java.math.BigInteger getPrimeQ()

  Specified by:
    `getPrimeQ` in interface `java.security.interfaces.RSAPrivateCrtKey`

### getPrimeExponentP

    public java.math.BigInteger getPrimeExponentP()

  Specified by:
    `getPrimeExponentP` in interface `java.security.interfaces.RSAPrivateCrtKey`

### getPrimeExponentQ

    public java.math.BigInteger getPrimeExponentQ()

  Specified by:
    `getPrimeExponentQ` in interface `java.security.interfaces.RSAPrivateCrtKey`

### getCrtCoefficient

    public java.math.BigInteger getCrtCoefficient()

  Specified by:
    `getCrtCoefficient` in interface `java.security.interfaces.RSAPrivateCrtKey`

### getPrivateExponent

    public java.math.BigInteger getPrivateExponent()

  Specified by:
    `getPrivateExponent` in interface `java.security.interfaces.RSAPrivateKey`

### getEncoded

    public byte[] getEncoded()

  Deprecated. see getEncoded(int).

  Specified by:
    `getEncoded` in interface `java.security.Key`

### getEncoded

    public byte[] getEncoded(int format)

  Returns the encoded form of this private key according to the designated format.

  Parameters:
    `format` - the desired format identifier of the resulting encoding.
  Returns:
    the byte sequence encoding this key according to the designated format.
  Throws:
    `java.lang.IllegalArgumentException` - if the format is not supported.
  See Also:
    `RSAKeyPairRawCodec`

### equals

    public boolean equals(java.lang.Object obj)

  Returns `true` if the designated object is an instance of this class and has the same DSS (Digital Signature Standard) parameter values as this one.

  Overrides:
    `equals` in class `GnuRSAKey`
  Parameters:
    `obj` - the other non-null DSS key to compare to.
  Returns:
    `true` if the designated object is of the same type and value as this one.

Overview | Package | Class | Tree | Deprecated | Index | Help
| For the latest news and information visit The GNU Crypto project
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright ©2001-2002 Free Software Foundation, Inc.. All Rights Reserved.