DSSKey (GNU cryptographic primitives and tools)
Keywords: gnu.crypto.key.dss.DSSKey,DSSKey class

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

## gnu.crypto.key.dss
Class DSSKey

    java.lang.Object
      |
      +--gnu.crypto.key.dss.DSSKey

All Implemented Interfaces:
  java.security.interfaces.DSAKey, java.security.Key, java.io.Serializable

Direct Known Subclasses:
  DSSPrivateKey, DSSPublicKey

public abstract class DSSKey
extends java.lang.Object
implements java.security.Key, java.security.interfaces.DSAKey

A base asbtract class for both public and private DSS (Digital Signature Standard) keys. It encapsulates the three DSS numbers: `p`, `q` and `g`.

According to the JDK, cryptographic Keys all have a format. The format used in this implementation is called Raw, and basically consists of the raw byte sequences of algorithm parameters. The exact order of the byte sequences and the implementation details are given in each of the relevant `getEncoded()` methods of each of the private and public keys.

See Also:
  `DSSPrivateKey.getEncoded(int)`, `DSSPublicKey.getEncoded(int)`, Serialized Form

Field Summary
`protected java.math.BigInteger` | `g` `g = h(p-1)/q mod p`, where `h` is any integer with `1 < h < p - 1` such that `h (p-1)/q mod p > 1` (`g` has order `q mod p` ).
`protected java.math.BigInteger` | `p` A prime modulus, where `2L-1 < p < 2L` for `512 <= L <= 1024` and `L` a multiple of `64`.
`protected java.math.BigInteger` | `q` A prime divisor of `p - 1`, where `2159 < q < 2160`.

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

Constructor Summary
`protected` | `DSSKey(java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger g)` Trivial protected constructor.

Method Summary
`boolean` | `equals(java.lang.Object obj)` Returns `true` if the designated object is an instance of `DSAKey` and has the same DSS (Digital Signature Standard) parameter values as this one.
`java.lang.String` | `getAlgorithm()`
`byte[]` | `getEncoded()` Deprecated. see getEncoded(int).
`abstract byte[]` | `getEncoded(int format)`
`java.lang.String` | `getFormat()`
`java.security.interfaces.DSAParams` | `getParams()`

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

Field Detail

### p

    protected final java.math.BigInteger p

  A prime modulus, where `2L-1 < p < 2L` for `512 <= L <= 1024` and `L` a multiple of `64`.

### q

    protected final java.math.BigInteger q

  A prime divisor of `p - 1`, where `2159 < q < 2160`.

### g

    protected final java.math.BigInteger g

  `g = h(p-1)/q mod p`, where `h` is any integer with `1 < h < p - 1` such that `h (p-1)/q mod p > 1` (`g` has order `q mod p` ).

Constructor Detail

### DSSKey

    protected DSSKey(java.math.BigInteger p,
                     java.math.BigInteger q,
                     java.math.BigInteger g)

  Trivial protected constructor.

Parameters:
  `p` - the DSS parameter `p`.
  `q` - the DSS parameter `q`.
  `g` - the DSS parameter `g`.

Method Detail

### getParams

    public java.security.interfaces.DSAParams getParams()

  Specified by:
    `getParams` in interface `java.security.interfaces.DSAKey`

### getAlgorithm

    public java.lang.String getAlgorithm()

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

### getEncoded

    public byte[] getEncoded()

  Deprecated. see getEncoded(int).

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

### getFormat

    public java.lang.String getFormat()

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

### equals

    public boolean equals(java.lang.Object obj)

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

  Overrides:
    `equals` in class `java.lang.Object`
  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.

### getEncoded

    public abstract byte[] getEncoded(int format)

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

Copyright © 2001, 2002, 2003, 2004 Free Software Foundation, Inc.