public class ScramAuth
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ScramAuth.Credentials |
static interface |
ScramAuth.NonceGenerator |
static class |
ScramAuth.RandomNonceGenerator |
class |
ScramAuth.SessionData |
Modifier and Type | Field and Description |
---|---|
static int |
CLIENT_NONCE_SIZE |
static int |
CRC_LENGTH |
static int |
ITERATION_NUMBER_SIZE |
ScramAuth.NonceGenerator |
nonceGenerator |
static int |
PASSWORD_LENGTH |
static int |
SERVER_NONCE_SIZE |
ScramAuth.SessionData |
sessionData |
Constructor and Description |
---|
ScramAuth(IoTizeDevice device) |
Modifier and Type | Method and Description |
---|---|
static byte[] |
clientProof(byte[] storedKey,
int clientNonce,
int serverNonce) |
static com.iotize.android.device.device.impl.scram.ScramAuth.Keys |
computeKeys(ScramAuth.Credentials credentials,
ScramLoginResponseBody loginBody,
int clientNonce) |
static byte[] |
computeProof(byte[] key,
int nonce1,
int nonce2) |
static byte[] |
computeSessionKey(int clientNonce,
int serverNonce,
byte[] userSalt,
byte[] serverKey,
byte[] storedKey) |
int |
generateNonce() |
byte[] |
getSessionKey() |
static byte[] |
HASH(byte[] input,
byte[] salt,
int iteration) |
void |
login(ScramAuth.Credentials params)
Perform login
|
void |
logout() |
static byte[] |
serverProof(byte[] serverKey,
int clientNonce,
int serverNonce) |
public static final int CRC_LENGTH
public static final int CLIENT_NONCE_SIZE
public static final int SERVER_NONCE_SIZE
public static final int PASSWORD_LENGTH
public static final int ITERATION_NUMBER_SIZE
public ScramAuth.SessionData sessionData
public ScramAuth.NonceGenerator nonceGenerator
public ScramAuth(IoTizeDevice device)
public void login(ScramAuth.Credentials params) throws java.lang.Exception
params
- java.lang.Error
- if scram is not activatedjava.lang.Exception
public void logout() throws java.lang.Exception
java.lang.Exception
public static com.iotize.android.device.device.impl.scram.ScramAuth.Keys computeKeys(ScramAuth.Credentials credentials, ScramLoginResponseBody loginBody, int clientNonce)
public static byte[] clientProof(byte[] storedKey, int clientNonce, int serverNonce)
public static byte[] serverProof(byte[] serverKey, int clientNonce, int serverNonce)
public byte[] getSessionKey()
public int generateNonce()
public static byte[] HASH(byte[] input, byte[] salt, int iteration)
input
- public static byte[] computeProof(byte[] key, int nonce1, int nonce2)
public static byte[] computeSessionKey(int clientNonce, int serverNonce, byte[] userSalt, byte[] serverKey, byte[] storedKey)