Package tigase.xmpp.impl
Class CaptchaProvider.SimpleTextCaptcha
java.lang.Object
tigase.xmpp.impl.CaptchaProvider.SimpleTextCaptcha
- All Implemented Interfaces:
CaptchaProvider.CaptchaItem
- Enclosing class:
CaptchaProvider
public static class CaptchaProvider.SimpleTextCaptcha
extends Object
implements CaptchaProvider.CaptchaItem
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleTextCaptcha(String[] parts) SimpleTextCaptcha(Random random, Supplier<SecretKeySpec> secretSupplier) -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]calculateHMac(byte[] data, String key) static byte[]calculateHMac(byte[] data, SecretKeySpec secretKeySpec) getCaptchaRequest(XMPPResourceConnection session) intgetID()protected Stringstatic Stringstatic StringgetSecret(XMPPResourceConnection connection) voidbooleanisResponseValid(Supplier<SecretKeySpec> secretKeySpecSupplier, String response) booleanisResponseValid(XMPPResourceConnection session, String response)
-
Constructor Details
-
SimpleTextCaptcha
-
SimpleTextCaptcha
-
-
Method Details
-
calculateHMac
public static byte[] calculateHMac(byte[] data, String key) throws NoSuchAlgorithmException, InvalidKeyException -
calculateHMac
public static byte[] calculateHMac(byte[] data, SecretKeySpec secretKeySpec) throws NoSuchAlgorithmException, InvalidKeyException -
getSecret
-
getSecret
-
getID
- Specified by:
getIDin interfaceCaptchaProvider.CaptchaItem
-
getPrefix
-
getCaptchaRequest
- Specified by:
getCaptchaRequestin interfaceCaptchaProvider.CaptchaItem
-
getCaptchaRequest
-
getErrorCounter
public int getErrorCounter()- Specified by:
getErrorCounterin interfaceCaptchaProvider.CaptchaItem
-
incraseErrorCounter
public void incraseErrorCounter()- Specified by:
incraseErrorCounterin interfaceCaptchaProvider.CaptchaItem
-
isResponseValid
- Specified by:
isResponseValidin interfaceCaptchaProvider.CaptchaItem
-
isResponseValid
-