ostore.security
Class SignedQSTree

java.lang.Object
  |
  +--ostore.security.SignedQS
        |
        +--ostore.security.SignedQSTree
All Implemented Interfaces:
QuickSerializable
Direct Known Subclasses:
ThresholdSignedQSTree

public class SignedQSTree
extends SignedQS

SignedQSTree

Version:
$Id: SignedQSTree.java,v 1.15 2002/08/16 00:00:09 srhea Exp $
Author:
Sean C. Rhea

Nested Class Summary
static class SignedQSTree.Root
           
 
Nested classes inherited from class ostore.security.SignedQS
SignedQS.SignatureBuffer
 
Field Summary
protected  QSArray _elts
           
 
Fields inherited from class ostore.security.SignedQS
_qs_signature, _qs_signature_type, _signature, _user_data
 
Constructor Summary
protected SignedQSTree()
           
  SignedQSTree(InputBuffer buffer)
           
  SignedQSTree(QSArray elts, QSSignature qs_signature, PrivateKey privkey, SecureRandom random, Signature engine)
           
 
Method Summary
static SignedQSTree.Root compute_root(QSArray elts)
           
static SecureHash[] compute_tree(QSArray elts)
           
static void main(String[] args)
          Test harness for SignedQS.
static int next_highest_power_of_two(int i)
           
 void serialize(OutputBuffer buffer)
          Add the object to the buffer.
 String toString()
           
 QuickSerializable user_data()
          The data which this object signs.
 boolean verify(PublicKey pubkey, Signature engine)
          Verify that the signature over user_data() is valid.
 
Methods inherited from class ostore.security.SignedQS
init, init, qs_signature, verify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_elts

protected QSArray _elts
Constructor Detail

SignedQSTree

protected SignedQSTree()

SignedQSTree

public SignedQSTree(QSArray elts,
                    QSSignature qs_signature,
                    PrivateKey privkey,
                    SecureRandom random,
                    Signature engine)
             throws InvalidKeyException,
                    SignatureException

SignedQSTree

public SignedQSTree(InputBuffer buffer)
             throws QSException
Method Detail

next_highest_power_of_two

public static int next_highest_power_of_two(int i)

compute_tree

public static SecureHash[] compute_tree(QSArray elts)

compute_root

public static SignedQSTree.Root compute_root(QSArray elts)

user_data

public QuickSerializable user_data()
Description copied from class: SignedQS
The data which this object signs. Please see the note about this in (QuickSerializable, KeyPair, SecureRandom, Signature). Also, note that SignedQS.verify(java.security.PublicKey, java.security.Signature) should be called to verify that the signature is correct.

Overrides:
user_data in class SignedQS
Returns:
the data which is signed

serialize

public void serialize(OutputBuffer buffer)
Description copied from interface: QuickSerializable
Add the object to the buffer.

Specified by:
serialize in interface QuickSerializable
Overrides:
serialize in class SignedQS
Parameters:
buffer - the output buffer to add the object to

verify

public boolean verify(PublicKey pubkey,
                      Signature engine)
               throws InvalidKeyException,
                      SignatureException,
                      TypeTable.NoSuchTypeCode
Description copied from class: SignedQS
Verify that the signature over SignedQS.user_data() is valid.

Overrides:
verify in class SignedQS
Parameters:
pubkey - The public key of the alleged signer of this message.
engine - a signature generating engine such that
provider  ().equals (engine.getProvider ().getName ())
and
algorithm ().equals (engine.getAlgorithm ())
These can be obtained through the function Signature.getInstance(String) or Signature.getInstance(String, String).
Returns:
true if the signature is valid, false otherwise
InvalidKeyException
SignatureException
TypeTable.NoSuchTypeCode

toString

public String toString()
Overrides:
toString in class SignedQS

main

public static void main(String[] args)
                 throws Exception
Description copied from class: SignedQS
Test harness for SignedQS.

Exception