|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectanon.util.captcha.ZipBinaryImageCaptchaClient
public class ZipBinaryImageCaptchaClient
This is the client implementation for all captchas of the "ZIP_BINARY_IMAGE" format.
| Field Summary | |
|---|---|
static java.lang.String |
CAPTCHA_DATA_FORMAT
This is the captcha format identifier for the class of captchas, which can be handled by this class implementation. |
private java.awt.Image |
m_captchaImage
Stores the captcha image. |
private int |
m_captchaKeyBits
Stores the number of captcha key bits. |
private int |
m_characterNumber
Stores the number of characters, which are embedded in the captcha image. |
private java.lang.String |
m_characterSet
Stores the character set, which was used when the captcha was created. |
private byte[] |
m_encodedData
Stores the encoded information. |
private int |
m_extraKeyBits
Stores the number of extra key bits (bits of the key, which we have to guess with brute force). |
| Constructor Summary | |
|---|---|
ZipBinaryImageCaptchaClient(org.w3c.dom.Element a_captchaEncodedNode)
Creates a new instance of ZipBinaryImageClient, which handles all captchas of the "ZIP_BINARY_IMAGE" format. |
|
| Method Summary | |
|---|---|
private byte[] |
generateNextKey(byte[] a_currentKey,
int a_mod8KeyBits)
Generates the next key, which is equal to the current key + 1. |
int |
getCharacterNumber()
Returns the number of characters which are included in the captcha. |
java.lang.String |
getCharacterSet()
Returns the character set which was used when the captcha was created. |
java.awt.Image |
getImage()
Returns the image with the captcha data. |
byte[] |
solveCaptcha(java.lang.String a_key,
byte[] a_startsWith)
Solves the captcha and returns the encoded information. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String CAPTCHA_DATA_FORMAT
private java.awt.Image m_captchaImage
private int m_captchaKeyBits
private int m_extraKeyBits
private java.lang.String m_characterSet
private int m_characterNumber
private byte[] m_encodedData
| Constructor Detail |
|---|
public ZipBinaryImageCaptchaClient(org.w3c.dom.Element a_captchaEncodedNode)
throws java.lang.Exception
a_captchaEncodedNode - The CaptchaEncoded node with the data of a "ZIP_BINARY_IMAGE"
captcha.
java.lang.Exception| Method Detail |
|---|
public java.awt.Image getImage()
getImage in interface IImageEncodedCaptchapublic java.lang.String getCharacterSet()
getCharacterSet in interface IImageEncodedCaptchapublic int getCharacterNumber()
getCharacterNumber in interface IImageEncodedCaptcha
public byte[] solveCaptcha(java.lang.String a_key,
byte[] a_startsWith)
throws java.lang.Exception
solveCaptcha in interface IImageEncodedCaptchaa_key - The key for solving the captcha (it's the string which is shown in the captcha
image).a_startsWith - byte[]
java.lang.Exception
private byte[] generateNextKey(byte[] a_currentKey,
int a_mod8KeyBits)
throws java.lang.Exception
a_currentKey - The current key, you should start with 000...000.a_mod8KeyBits - This is the number of key bits mod 8 in the current key. This value
describes how many bits of the highest order byte are used (attention:
a value of 0 means, that all bits are used).
java.lang.Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||