ostore.security
Class SignedQSArray.Individual
java.lang.Object
|
+--ostore.security.SignedQS
|
+--ostore.security.SignedQSArray.Individual
- All Implemented Interfaces:
- Digestible, QuickSerializable
- Enclosing class:
- SignedQSArray
- public static class SignedQSArray.Individual
- extends SignedQS
Method Summary |
void |
add_to_digest(SecureHashBuffer buffer)
Adds this object's state to the specified
SecureHashBuffer using the various add
methods. |
QSSignature |
qs_signature()
The type of signature over this object. |
void |
to_bytes(byte[] data,
int[] offset)
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. |
int |
type_code()
Returns the unique integer associated with this class in the
TypeTable . |
QuickSerializable |
user_data()
The data which this object signs. |
boolean |
verify(PublicKey pubkey,
Signature engine)
Verify that the signature over user_data() is valid. |
SignedQSArray.Individual
public SignedQSArray.Individual(QuickSerializable user_data,
SignedQS signed_object_hashes,
int number)
SignedQSArray.Individual
public SignedQSArray.Individual(byte[] data,
int[] offset)
throws QSException
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
- Following copied from class:
ostore.security.SignedQS
- Returns:
- the data which is signed
qs_signature
public QSSignature qs_signature()
throws TypeTable.NoSuchTypeCode
- Description copied from class:
SignedQS
- The type of signature over this object.
- Overrides:
qs_signature
in class SignedQS
- Following copied from class:
ostore.security.SignedQS
- Returns:
- a subtype QSSignature such that if an object of type
Signature
is generated where with a
matching algorithm and provider, that engine can be safely
passed to the verify function without fear of the latter
throwing an exception. - Throws:
TypeTable.NoSuchTypeCode
- if the type code included in the
encoding of this message does not correspond to a known
type on this host. In other words, if the message was
signed with an unknown algorithm.
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.
- Overrides:
to_bytes
in class SignedQS
- 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.
add_to_digest
public void add_to_digest(SecureHashBuffer buffer)
- Description copied from interface:
Digestible
- Adds this object's state to the specified
SecureHashBuffer
using the various add
methods.
- Overrides:
add_to_digest
in class SignedQS
- Following copied from interface:
ostore.util.Digestible
- See Also:
SecureHashBuffer.add( byte )
,
SecureHashBuffer.add( byte[] )
,
SecureHashBuffer.add( byte[], int, int )
,
SecureHashBuffer.add( Digestible )
type_code
public int type_code()
- Description copied from interface:
QuickSerializable
- Returns the unique integer associated with this class in the
TypeTable
.
- Overrides:
type_code
in class SignedQS
- Following copied from interface:
ostore.util.QuickSerializable
- Returns:
- an integer unique to this class
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
- Following copied from class:
ostore.security.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- Throws:
TypeTable.NoSuchTypeCode
- if the type code included in the
encoding of this message does not correspond to a known
type on this host. In other words, if the message was
signed with an unknown algorithm.