Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle Security Developer Tools Crypto Java API Reference 10g Release 3 (10.1.3) B25378-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.security.crypto.core
Class DHKey

`java.lang.Object
oracle.security.crypto.core.DHKey`

All Implemented Interfaces:
  ASN1Object, java.lang.Cloneable, java.io.Externalizable, Key, java.io.Serializable, Streamable

Direct Known Subclasses:
  DHPrivateKey, DHPublicKey

public abstract class DHKey
extends java.lang.Object
implements Key, ASN1Object, java.io.Externalizable

*** For internal use only *** An abstract class for Diffie-Hellman keys.

Status: Provisional (may be changed in future releases.)

See Also:
  `DHParams`, `DHPublicKey`, `DHPrivateKey`, Serialized Form

Field Summary
`protected DHParams` | `params`

Constructor Summary
`protected` | `DHKey()`
`protected` | `DHKey(DHParams params)`
`protected` | `DHKey(java.io.InputStream is)`

Method Summary
`abstract java.lang.Object` | `clone()` Create a deep clone of this `DHKey` object.
`java.lang.String` | `getAlgorithm()` Returns the algorithm for which this key is primarily used.
`int` | `getBitLength()` Returns the number of bits required to represent this key's defining key material
`byte[]` | `getEncoded()` Returns the encoded form of this key.
`DHParams` | `getParams()` Returns the Diffie-Hellman parameters for this key.
`void` | `readExternal(java.io.ObjectInput is)`
`abstract void` | `setParams(DHParams params)` Sets the parameters for the Diffie-Hellman key.
`void` | `writeExternal(java.io.ObjectOutput os)`

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

Methods inherited from interface oracle.security.crypto.core.Key
`erase, getFormat`

Methods inherited from interface oracle.security.crypto.util.Streamable
`input, length, output`

Field Detail

### params

    protected DHParams params

Constructor Detail

### DHKey

    protected DHKey()

### DHKey

    protected DHKey(DHParams params)

### DHKey

    protected DHKey(java.io.InputStream is)
             throws java.io.IOException

Method Detail

### getAlgorithm

    public java.lang.String getAlgorithm()

  Description copied from interface: `Key`
  Returns the algorithm for which this key is primarily used.
  Specified by:
    `getAlgorithm` in interface `Key`

### getEncoded

    public byte[] getEncoded()

  Description copied from interface: `Key`
  Returns the encoded form of this key.
  Specified by:
    `getEncoded` in interface `Key`

### getBitLength

    public int getBitLength()

  Description copied from interface: `Key`
  Returns the number of bits required to represent this key's defining key material

  i.e. In the case of an RSA key, the modulus' bit length would be returned .

  Specified by:
    `getBitLength` in interface `Key`

### clone

    public abstract java.lang.Object clone()

  Create a deep clone of this `DHKey` object.
  Specified by:
    `clone` in interface `Key`

### getParams

    public DHParams getParams()

  Returns the Diffie-Hellman parameters for this key.
  Returns:
    A `DHParams` object, or `null` if none is present in this `DHKey`.

### setParams

    public abstract void setParams(DHParams params)

  Sets the parameters for the Diffie-Hellman key. This method is used to set Diffie-Hellman parameters common to a group of users which are known from application context.
  Parameters:
    `params` - An instance of `DHParams`.
  Throws:
    `java.lang.IllegalArgumentException` - If p, q or g is missing from the params.

### writeExternal

    public void writeExternal(java.io.ObjectOutput os)
                       throws java.io.IOException

  Specified by:
    `writeExternal` in interface `java.io.Externalizable`
  Throws:
    `java.io.IOException`

### readExternal

    public void readExternal(java.io.ObjectInput is)
                      throws java.io.IOException,
                             java.lang.ClassNotFoundException

  Specified by:
    `readExternal` in interface `java.io.Externalizable`
  Throws:
    `java.io.IOException`
    `java.lang.ClassNotFoundException`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle Security Developer Tools Crypto Java API Reference 10g Release 3 (10.1.3) B25378-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2005, 2006 , Oracle. All rights reserved.