ostore.security.thresh
Class ThresholdSignature
java.lang.Object
|
+--java.security.SignatureSpi
|
+--java.security.Signature
|
+--ostore.security.thresh.ThresholdSignature
- All Implemented Interfaces:
- QSSignature, QuickSerializable
- public class ThresholdSignature
- extends Signature
- implements QSSignature
A verification signature engine for threshold signatures. Will not
actually produce signatures, only verify them.
- Version:
- $Id: ThresholdSignature.java,v 1.5 2001/11/16 22:44:45 geels Exp $
- Author:
- Sean C. Rhea
Methods inherited from class java.security.Signature |
clone, getAlgorithm, getInstance, getInstance, getParameter, getProvider, initSign, initSign, initVerify, initVerify, setParameter, setParameter, sign, sign, toString, update, update, update, verify |
ThresholdSignature
public ThresholdSignature()
ThresholdSignature
public ThresholdSignature(byte[] data,
int[] offset)
algorithm
public String algorithm()
- Description copied from interface:
QSSignature
- The signing algorithm. Using this and the value of
QSSignature.provider()
, a user of this class should be able to produce a
signature engine to pass to SignedQS.verify(java.security.PublicKey, java.security.Signature)
by calling Signature.getInstance(String, String)
.
- Specified by:
algorithm
in interface QSSignature
- Following copied from interface:
ostore.security.QSSignature
- Returns:
- the name of the digital signature algorithm, for instance,
"SHA-1/RSA/PKCS#1"
provider
public String provider()
- Description copied from interface:
QSSignature
- The signing algorithm's provider, as used with
getInstance
. Using this and the value of QSSignature.algorithm()
, a user of this class should be able to produce a
signature engine to pass to SignedQS.verify(java.security.PublicKey, java.security.Signature)
by calling
Signature.getInstance(String, String)
.
- Specified by:
provider
in interface QSSignature
- Following copied from interface:
ostore.security.QSSignature
- Returns:
- the name of the digital signature algorithm provider, for
instance, "CryptixCrypto"
to_bytes
public void to_bytes(byte[] data,
int[] offset)
- Description copied from interface:
QuickSerializable
- Store the object in its "on the wire" form in the byte array
data
, starting at index offset [0]
, and
increment offset [0]
by the number of bytes written;
if data == null
, increment offset [0]
by
the number of bytes that would have been written otherwise.
- Specified by:
to_bytes
in interface QuickSerializable
- Following copied from interface:
ostore.util.QuickSerializable
- Parameters:
data
- The byte array to store into, or null
.offset
- A single element array whose first
element is the index in data to begin writing at on
function entry, and which on function exit has been
incremented by the number of bytes written.
type_code
public int type_code()
- Description copied from interface:
QuickSerializable
- Returns the unique integer associated with this class in the
TypeTable
.
- Specified by:
type_code
in interface QuickSerializable
- Following copied from interface:
ostore.util.QuickSerializable
- Returns:
- an integer unique to this class
equals
public boolean equals(Object obj)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
engineInitSign
protected void engineInitSign(PrivateKey key)
throws InvalidKeyException
- Overrides:
engineInitSign
in class SignatureSpi
engineInitVerify
protected void engineInitVerify(PublicKey key)
throws InvalidKeyException
- Overrides:
engineInitVerify
in class SignatureSpi
engineUpdate
protected void engineUpdate(byte b)
throws SignatureException
- Overrides:
engineUpdate
in class SignatureSpi
engineUpdate
protected void engineUpdate(byte[] in,
int offset,
int length)
throws SignatureException
- Overrides:
engineUpdate
in class SignatureSpi
engineSign
protected byte[] engineSign()
throws SignatureException
- Overrides:
engineSign
in class SignatureSpi
engineVerify
protected boolean engineVerify(byte[] signature)
throws SignatureException
- Overrides:
engineVerify
in class SignatureSpi
verify
public boolean verify(SigShare[] sigs)
- Verify the signature without encoding the signature shares into
bytes. This method is more efficient than using
Signature.verify(byte[])
if the SigShare
s are already
deserialized, but it requires knowing the Signature
type (i.e., casting down to ThresholdSignature
).
As with the Signature.verify(byte[])
method, this signature object
is reset (via calling engineInitVerify(java.security.PublicKey)
) at the end of this
method.
engineSetParameter
protected void engineSetParameter(String param,
Object value)
throws InvalidParameterException
- Overrides:
engineSetParameter
in class SignatureSpi
engineGetParameter
protected Object engineGetParameter(String param)
throws InvalidParameterException
- Overrides:
engineGetParameter
in class SignatureSpi