Node:The ISignatureCodec Interface, Next:Signature Example, Previous:The SignatureFactory Class, Up:Signatures
The ISignatureCodec
interface defines methods for externalizing
and de-externalizing native signature results, as would be returned by
the ISignature.sign()
method, or passed to
ISignature.verify()
method. The only format currently supported
is the "RAW" codec, which is specific to GNU Crypto.
Each signature scheme implements its own raw codec. There is no factory for codecs, but rather you should create instances of
gnu.crypto.sig.dss.DSSSignatureRawCodec
if you are reading or
writing DSS signatures, or
gnu.crypto.sig.rsa.RSAPSSSignatureRawCodec
if you are reading
or writing RSA-PSS signatures.
Each of these classes has a zero-argument constructor, needs no initialization, and defines these methods:
java.lang.Object decodeSignature (byte[] encoded) | Function |
Decodes a signature from the byte represention encoded, and
returns the signature in the signature algorithm's native
form. Implementations may throw an unchecked exception (such as
java.lang.IlligalArgumentException ) if the argument
is improperly formatted.
|
byte [] encodeSignature (java.lang.Object signature) | Function |
Encodes a native signature to an external byte representation.
Implementations may throw an unchecked exception (such as
java.lang.IlligalArgumentException ) if the argument
is not of the algorithm's native signature type.
|
int getFormatID () | Function |
Returns the format identifier for this codec, such as
RAW_FORMAT .
|
int RAW_FORMAT | Variable |
Format identifier for GNU's "raw" codec. |