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.dss
Class DSSSignatureRawCodec

    java.lang.Object
      |
      +--gnu.crypto.sig.dss.DSSSignatureRawCodec

All Implemented Interfaces:
  ISignatureCodec

public class DSSSignatureRawCodec
extends java.lang.Object
implements ISignatureCodec

An object that implements the `ISignatureCodec` operations for the Raw format to use with DSS signatures.

Version:
  $Revision: 1.1 $

Fields inherited from interface gnu.crypto.sig.ISignatureCodec
`RAW_FORMAT`

Constructor Summary
`DSSSignatureRawCodec()`

Method Summary
`java.lang.Object` | `decodeSignature(byte[] k)`
`byte[]` | `encodeSignature(java.lang.Object signature)` Returns the encoded form of the designated DSS (Digital Signature Standard) signature object according to the Raw format supported by this library.
`int` | `getFormatID()`

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

Constructor Detail

### DSSSignatureRawCodec

    public DSSSignatureRawCodec()

Method Detail

### getFormatID

    public int getFormatID()

  Specified by:
    `getFormatID` in interface `ISignatureCodec`

### encodeSignature

    public byte[] encodeSignature(java.lang.Object signature)

  Returns the encoded form of the designated DSS (Digital Signature Standard) signature object according to the Raw format supported by this library.

  The Raw format for a DSA signature, in this implementation, is a byte sequence consisting of the following:

  1. 4-byte magic consisting of the constant: 0x474E5542,
  3. 1-byte version consisting of the constant: 0x01,
  4. 4-byte count of following bytes representing the DSS parameter `r` in internet order,
  5. n-bytes representation of a `BigInteger` obtained by invoking the `toByteArray()` method on the DSS parameter `r`,
  6. 4-byte count of following bytes representing the DSS parameter `s`,
  7. n-bytes representation of a `BigInteger` obtained by invoking the `toByteArray()` method on the DSS parameter `s`.
  Specified by:
    `encodeSignature` in interface `ISignatureCodec`
  Parameters:
    `signature` - the signature to encode, consisting of the two DSS parameters `r` and `s` as a `BigInteger` array.
  Returns:
    the Raw format encoding of the designated signature.
  Throws:
    `java.lang.IllegalArgumentException` - if the designated signature is not a DSS (Digital Signature Standard) one.

### decodeSignature

    public java.lang.Object decodeSignature(byte[] k)

  Specified by:
    `decodeSignature` in interface `ISignatureCodec`

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.