wtanaka.praya.gale
Class KeyFragment

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

public class KeyFragment
extends AbstractFragment

Represents a signature fragment

Return to Sourceforge or the Praya Homepage

Version:
$Name: $ $Date: 2001/09/30 21:14:52 $
Author:
$Author: wtanaka $

Field Summary
private  GalePublicKey m_key
           
private  byte[] m_keyData
           
 
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
KeyFragment(java.lang.String fragmentName, byte[] fragmentData)
          Constructs a new key fragment with a bunch of data and a key to sign with.
KeyFragment(java.lang.String fragmentName, GalePublicKey key)
           
 
Method Summary
 GalePublicKey getPublicKey()
           
 int getStreamLength()
           
 FragmentType getType()
           
 java.lang.String toString(int indentLevel)
           
 void write(GaleOutputStream out)
          Writes this key 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, toString, wait, wait, wait
 

Field Detail

m_keyData

private byte[] m_keyData

m_key

private GalePublicKey m_key
Constructor Detail

KeyFragment

public KeyFragment(java.lang.String fragmentName,
                   byte[] fragmentData)
            throws java.io.IOException
Constructs a new key fragment with a bunch of data and a key to sign with. Does not keep a reference to the key.

KeyFragment

public KeyFragment(java.lang.String fragmentName,
                   GalePublicKey key)
            throws NotEnoughInfoException
Method Detail

getType

public FragmentType getType()

getPublicKey

public GalePublicKey getPublicKey()

getStreamLength

public int getStreamLength()

write

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

toString

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