|
CIC iSign Version 1.2 | ||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||
java.lang.Object | +--InkTools.CicServer
Provides highlevel functions for signature enrollment and verification for servlet development. Since servlets don't need UI elements, this class is the center piece for the servlet, similar as the CicInkControl is the center piece for an applet. The main task handled by a servlet will be signature verification, since signatures are captured in the applet on the front end. All the verification functions (enrollment, loading of templates and verification) are already in the CicSigCheck class, but are here wraped in a more convienence way to use within a servlet. Also wrapped is the CicUtils funtion for generating Jpegs from a CicDoodle object.
The idea is that a servlet gets ink data via HTTP tunneling in form of a byte stream, then creates a CicDoodle object in which the ink byte stream is streamed in. Then this doodle object can be used for the various function in this class.
The servlet developer is responsible for the user template management. This class provides functions for loading template and do verification against it, but not to handle a template database.
Note that the template maybe automatically was updated. For that reason, call the 'templateIsUpdated' function after every verification and retrieve and save the new template (use 'getTemplate) if it is required.
| Constructor Summary | |
CicServer()
Constructs a new CicServer object. |
|
| Method Summary | |
CicReturn |
createGifFromSig(java.lang.String fileName,
CicDoodle sigDoodle,
int width,
int height)
Creates a Gif image from a signature. |
CicReturn |
createJpegFromSig(java.lang.String fileName,
byte[] signature,
int width,
int height,
java.lang.String key)
Creates a Jpeg image from a signature. |
CicReturn |
createJpegFromSig(java.lang.String fileName,
CicDoodle sigDoodle,
int width,
int height)
Creates a Jpeg image from a signature. |
int |
enrollSignature(CicDoodle newDoodle)
Enrolls a user signature one by one until all 3 valid signatures are passed in. |
CicSigCheck |
getSigCheckClass()
Returns the current CicSigCheck class. |
byte[] |
getTemplate(boolean bRemoveNonePrinting)
Returns the current loaded template as a byte stream after it was enrolled or streamed in propperly. |
void |
initEnrollment()
Resets the phase of the enrollment process to start anew. |
CicReturn |
loadEncryptedTemplate(byte[] template,
java.lang.String key)
Loads an encrypted signature template from a byte stream into the CicSigCheck object. |
CicReturn |
loadEncryptedTemplate(java.lang.String fileName,
java.lang.String key)
Loads an encrypted signature template from a file into the CicSigCheck object. |
CicReturn |
loadTemplate(byte[] template)
Loads an unencrypted signature template from a byte stream into the CicSigCheck object. |
CicReturn |
loadTemplate(java.lang.String fileName)
Loads an unencrypted signature template from a file into the CicSigCheck object. |
void |
setEncryptionParam(java.lang.String key)
Sets the encryption parameters for loading and enrolling templates (in the CicSigCheck class). |
boolean |
templateIsUpdated()
Checks if the current template was updated by the last verification. |
CicReturn |
verifySignature(byte[] signature)
Verifies a signature against the previously loaded template. |
CicReturn |
verifySignature(byte[] signature,
java.lang.String key)
Verifies a signature against the previously loaded template. |
CicReturn |
verifySignature(CicDoodle sigDoodle)
Verifies a signature against the previously loaded template. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CicServer()
| Method Detail |
public CicReturn loadTemplate(byte[] template)
template - template byte stream
public CicReturn loadEncryptedTemplate(byte[] template,
java.lang.String key)
template - template byte streamkey - encryption key for decrypting the template
public CicReturn loadTemplate(java.lang.String fileName)
fileName - template file name
public CicReturn loadEncryptedTemplate(java.lang.String fileName,
java.lang.String key)
fileName - template file name
public int enrollSignature(CicDoodle newDoodle)
If the enrollment function determins that the signatures are too 'simple', a '0' will be returned. The user should then get notified about that. If the signatures where inconsistent after 3 signatures, the return of a '1' will request more signatures for the enrollment until all signatures are consistend enough for the enrollment.
Note: set the enryption parameter for the signature before calling this function.
newDoodle - the signature in an CicDoodle object added to the
current enrollment process
public byte[] getTemplate(boolean bRemoveNonePrinting)
bRemoveNonePrinting - true if all none printable bytes should be
replaced with ASCI encoding (increases template size), otherwise
false
public boolean templateIsUpdated()
public void setEncryptionParam(java.lang.String key)
key - the encryption key or null for disabling the encryption.public void initEnrollment()
public CicReturn verifySignature(byte[] signature)
signature - the ink data in form of a byte stream
public CicReturn verifySignature(byte[] signature,
java.lang.String key)
signature - the signature data in form of a byte stream
public CicReturn verifySignature(CicDoodle sigDoodle)
sigDoodle - CicDoodle object containing the signature
public CicSigCheck getSigCheckClass()
public CicReturn createJpegFromSig(java.lang.String fileName,
byte[] signature,
int width,
int height,
java.lang.String key)
fileName - the file name under which the newly created
Jpeg image should get savedsignature - the byte stream of the signaturewidth - the width of the Jpeg imageheight - the height of the Jpeg imagekey - the encryption key if signature is encrypted, otherwise null
public CicReturn createJpegFromSig(java.lang.String fileName,
CicDoodle sigDoodle,
int width,
int height)
fileName - the file name under which the newly created
Jpeg image should get savedsigDoodle - the signature in form of a CicDoodle objectwidth - The width of the Jpeg imageheight - The height of the Jpeg image
public CicReturn createGifFromSig(java.lang.String fileName,
CicDoodle sigDoodle,
int width,
int height)
See Copyright notice in the CicUtils class for the Gif encoder.
fileName - the file name under which the newly created
Jpeg image should get savedsigDoodle - the signature in form of a CicDoodle objectwidth - The width of the Jpeg imageheight - The height of the Jpeg image
|
CIC iSign Version 1.2 | ||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||