|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectewe.security.Signature
A Signature is used to either hold a received Ewe digital signature, or to generate a Ewe digital signature.
| Field Summary | |
int |
length
This is the length of the document being signed. |
byte[] |
signature
This is the fully encoded signature bytes for transmission or storage along with the document. |
EncryptionKey |
signersKey
This is the signer's public key (for verifying signatures) or private key (for creating signatures). |
Time |
time
This is an optional timestamp to be embedded in the signature. |
| Constructor Summary | |
Signature(byte[] signature,
EncryptionKey signersPublicKey)
This is used on a signature that has already been generated. |
|
Signature(EncryptionKey signersPrivateKey,
Time signatureTime)
Create a Signature object in preparation for signing. |
|
| Method Summary | |
byte[] |
sign(byte[] data,
int offset,
int length,
SHA1 digest)
Produce a signature for a document. |
boolean |
verify(byte[] data,
int offset,
int length,
SHA1 digest)
Verify that a document is the same as the one that was signed with this signature. |
boolean |
verify(int dataLength,
byte[] digest)
Verify that a document with a particular data length and with a particular digest bytes is the same as the one that was signed with this signature. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, toString |
| Field Detail |
public EncryptionKey signersKey
public Time time
public int length
public byte[] signature
| Constructor Detail |
public Signature(byte[] signature,
EncryptionKey signersPublicKey)
throws StreamCorruptedException
After calling this constructor you can call the verify() methods to verify if a document is the one that was signed.
signature - the recieved or stored encoded signature bytes.signersPublicKey - the public key of the signer.
StreamCorruptedException - if the data is invalid in any way.
public Signature(EncryptionKey signersPrivateKey,
Time signatureTime)
signatureTime - an optional timestamp to include in the signature.| Method Detail |
public byte[] sign(byte[] data,
int offset,
int length,
SHA1 digest)
throws IOException
data - the data bytes to sign.offset - the start of the data bytes in the data parameter.length - the number of bytes in the data.digest - an optional pre-created SHA1 object to create the document digest.
IOException - if an encryption of data processing error occurs.
public boolean verify(int dataLength,
byte[] digest)
dataLength - the length of the data.digest - the SHA1 digest of the data.
public boolean verify(byte[] data,
int offset,
int length,
SHA1 digest)
data - the data to verify.offset - the start of the data.length - the number of bytes in the data.digest - an optional pre-created SHA1 object to digest the data.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||