public abstract class AbstractScram extends AbstractSaslMechanism
Modifier and Type | Class and Description |
---|---|
static class |
AbstractScram.BindType |
Modifier and Type | Field and Description |
---|---|
protected static Charset |
UTF_CHARSET |
SASL_COMPLETE_KEY
FORCE_AUTHZID
Modifier | Constructor and Description |
---|---|
protected |
AbstractScram(String mechanismName,
String algorithm,
byte[] clientKey,
byte[] serverKey) |
Modifier and Type | Method and Description |
---|---|
String |
evaluateChallenge(String input,
SessionObject sessionObject)
Evaluating challenge received from server.
|
protected abstract byte[] |
getBindData(AbstractScram.BindType bindType,
SessionObject sessionObject) |
protected abstract AbstractScram.BindType |
getBindType(SessionObject sessionObject) |
protected tigase.jaxmpp.core.client.xmpp.modules.auth.scram.AbstractScram.Data |
getData(SessionObject sessionObject) |
protected byte[] |
h(byte[] data) |
static byte[] |
hi(String algorithm,
byte[] password,
byte[] salt,
int iterations) |
protected static byte[] |
hmac(SecretKey key,
byte[] data) |
boolean |
isAllowedToUse(SessionObject sessionObject)
This method is used to check if mechanism can be used with current
session.
|
protected SecretKey |
key(byte[] key) |
String |
name()
Return mechanism name.
|
static byte[] |
normalize(String str) |
protected String |
randomString() |
protected byte[] |
xor(byte[] a,
byte[] b) |
isComplete, setComplete
protected static final Charset UTF_CHARSET
public static byte[] hi(String algorithm, byte[] password, byte[] salt, int iterations) throws InvalidKeyException, NoSuchAlgorithmException
protected static byte[] hmac(SecretKey key, byte[] data) throws NoSuchAlgorithmException, InvalidKeyException
public static byte[] normalize(String str)
public String evaluateChallenge(String input, SessionObject sessionObject) throws ClientSaslException
SaslMechanism
input
- received datasessionObject
- current SessionObjectClientSaslException
protected abstract byte[] getBindData(AbstractScram.BindType bindType, SessionObject sessionObject)
protected abstract AbstractScram.BindType getBindType(SessionObject sessionObject)
protected tigase.jaxmpp.core.client.xmpp.modules.auth.scram.AbstractScram.Data getData(SessionObject sessionObject)
protected byte[] h(byte[] data) throws NoSuchAlgorithmException
NoSuchAlgorithmException
public boolean isAllowedToUse(SessionObject sessionObject)
SaslMechanism
sessionObject
- current SessionObjecttrue
if mechanism can be used it current XMPP session.protected SecretKey key(byte[] key)
public String name()
SaslMechanism
protected String randomString()
protected byte[] xor(byte[] a, byte[] b)
Copyright © 2006–2023 Tigase. All rights reserved.