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
_elts
protected QSArray _elts
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
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