gnu.crypto.sig.dss
Class DSSSignatureRawCodec
java.lang.Object
gnu.crypto.sig.dss.DSSSignatureRawCodec
- ISignatureCodec
public class DSSSignatureRawCodec
extends java.lang.Object
An object that implements the
ISignatureCodec
operations for the
Raw format to use with DSS signatures.
Version:
Object | decodeSignature(byte[] k)
|
byte[] | encodeSignature(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:
- 4-byte magic consisting of the value of the literal
Registry.MAGIC_RAW_DSS_SIGNATURE ,
- 1-byte version consisting of the constant: 0x01,
- 4-byte count of following bytes representing the DSS parameter
r in internet order,
- n-bytes representation of a
BigInteger obtained by invoking
the toByteArray() method on the DSS parameter r ,
- 4-byte count of following bytes representing the DSS parameter
s ,
- n-bytes representation of a
BigInteger obtained by invoking
the toByteArray() method on the DSS parameter s .
|
int | getFormatID()
|
encodeSignature
public byte[] encodeSignature(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:
- 4-byte magic consisting of the value of the literal
Registry.MAGIC_RAW_DSS_SIGNATURE
,
- 1-byte version consisting of the constant: 0x01,
- 4-byte count of following bytes representing the DSS parameter
r
in internet order,
- n-bytes representation of a
BigInteger
obtained by invoking
the toByteArray()
method on the DSS parameter r
,
- 4-byte count of following bytes representing the DSS parameter
s
,
- n-bytes representation of a
BigInteger
obtained by invoking
the toByteArray()
method on the DSS parameter s
.
- encodeSignature in interface ISignatureCodec
signature
- the signature to encode, consisting of the two DSS
parameters r
and s
as a java.math.BigInteger
array.
- the Raw format encoding of the designated signature.
Copyright © 2001, 2002, 2003
Free Software Foundation,
Inc. All Rights Reserved.