For the latest news and information visit
The GNU Crypto project

gnu.crypto.sig.rsa
Class RSAPSSSignatureRawCodec

java.lang.Object
  extended bygnu.crypto.sig.rsa.RSAPSSSignatureRawCodec
All Implemented Interfaces:
ISignatureCodec

public class RSAPSSSignatureRawCodec
extends java.lang.Object
implements ISignatureCodec

An object that implements the ISignatureCodec operations for the Raw format to use with RSA-PSS signatures.

Version:
$Revision: 1.2 $

Field Summary
 
Fields inherited from interface gnu.crypto.sig.ISignatureCodec
RAW_FORMAT
 
Constructor Summary
RSAPSSSignatureRawCodec()
           
 
Method Summary
 java.lang.Object decodeSignature(byte[] k)
           
 byte[] encodeSignature(java.lang.Object signature)
          Returns the encoded form of the designated RSA-PSS 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

RSAPSSSignatureRawCodec

public RSAPSSSignatureRawCodec()
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 RSA-PSS signature object according to the Raw format supported by this library.

The Raw format for an RSA-PSS signature, in this implementation, is a byte sequence consisting of the following:

  1. 4-byte magic consisting of the value of the literal Registry.MAGIC_RAW_RSA_PSS_SIGNATURE,
  2. 1-byte version consisting of the constant: 0x01,
  3. 4-byte count of following bytes representing the RSA-PSS signature bytes in internet order,
  4. the RSA-PSS signature bytes in internet order.

Specified by:
encodeSignature in interface ISignatureCodec
Parameters:
signature - the signature to encode, consisting of the output of the sign() method of a RSAPSSSignature instance --a byte array.
Returns:
the Raw format encoding of the designated signature.
Throws:
java.lang.IllegalArgumentException - if the designated signature is not an RSA-PSS one.

decodeSignature

public java.lang.Object decodeSignature(byte[] k)
Specified by:
decodeSignature in interface ISignatureCodec

For the latest news and information visit
The GNU Crypto project

Copyright © 2001, 2002, 2003 Free Software Foundation, Inc. All Rights Reserved.