wtanaka.praya.gale
Class SignatureFragment

java.lang.Object
  |
  +--wtanaka.praya.gale.AbstractFragment
        |
        +--wtanaka.praya.gale.SignatureFragment
All Implemented Interfaces:
FragmentInterface

public class SignatureFragment
extends AbstractFragment

Represents a signature fragment.

Return to Sourceforge or the Praya Homepage

Version:
$Name: $ $Date: 2001/11/11 22:41:07 $
Author:
$Author: wtanaka $

Field Summary
private  FragmentList m_fragmentList
           
private  byte[] m_signatureData
           
 
Fields inherited from class wtanaka.praya.gale.AbstractFragment
m_fragmentName
 
Fields inherited from interface wtanaka.praya.gale.FragmentInterface
BODY, CLASS, ENCRYPTED, INSTANCE, KEY_MEMBER, KEY_REDIRECT, NWO_KEY, NWO_KEY_REQUEST, NWO_RECEIPT, NWO_RECEIPT_REQ, OWO_KEY, OWO_KEY_REQUEST, OWO_RECEIPT, OWO_RECEIPT_REQ, PRESENCE, SENDER, SIGNATURE, TIME
 
Constructor Summary
SignatureFragment(FragmentList listToSign, GalePrivateKey priv)
          Constructs a new signature fragment with a bunch of data and a key to sign with.
SignatureFragment(java.lang.String fragmentName, byte[] fragmentData)
          Constructs a new signature fragment from its marshalled format.
 
Method Summary
 java.lang.String getClaimedID()
           
 FragmentList getFragmentList()
           
 int getStreamLength()
           
 FragmentType getType()
           
private static byte[] signatureFodder(FragmentList fragmentList)
           
 java.lang.String toString()
           
 java.lang.String toString(int indentLevel)
           
 void verify(GalePublicKey publicKey)
          Calculates whether or not this signature is verified.
 void write(GaleOutputStream out)
          Writes this signature fragment to the given output stream, locking it with synchronized (out).
 
Methods inherited from class wtanaka.praya.gale.AbstractFragment
getFragmentName
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

m_signatureData

private byte[] m_signatureData

m_fragmentList

private FragmentList m_fragmentList
Constructor Detail

SignatureFragment

public SignatureFragment(FragmentList listToSign,
                         GalePrivateKey priv)
                  throws java.security.NoSuchAlgorithmException
Constructs a new signature fragment with a bunch of data and a key to sign with. Does not keep a reference to the key.
Parameters:
listToSign - the fragment list to embed in this SignatureFragment, signed by the private key given by priv.
priv - the non-null private key to sign with

SignatureFragment

public SignatureFragment(java.lang.String fragmentName,
                         byte[] fragmentData)
                  throws java.io.IOException
Constructs a new signature fragment from its marshalled format.
Method Detail

getType

public FragmentType getType()

signatureFodder

private static byte[] signatureFodder(FragmentList fragmentList)
                               throws java.io.IOException

verify

public void verify(GalePublicKey publicKey)
            throws AuthException,
                   InvalidKeyFormatException
Calculates whether or not this signature is verified.

getClaimedID

public java.lang.String getClaimedID()

getFragmentList

public FragmentList getFragmentList()

getStreamLength

public int getStreamLength()

write

public void write(GaleOutputStream out)
           throws java.io.IOException
Writes this signature fragment to the given output stream, locking it with synchronized (out).
Parameters:
out - the stream on which to write this signature fragment.

toString

public java.lang.String toString(int indentLevel)
Overrides:
toString in class AbstractFragment

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object