Skip to content

ScramService

Method LWM2M request Description
getScramComSendReceive GET /interface/scram/com-send-receive Communication channel
getScramComStart GET /interface/scram/com-start Start scram communication
getScramHashIt GET /interface/scram/hash-it Get scram hash it
getScramLogin GET /interface/scram/login First command to initiate scram login, for client to send login and nonce to IoTize, and IoTize to return user salt, user iteration counter (j) and combined nonce
getScramLoginProof GET /interface/scram/login-proof Scram login proof
getScramUserIteration GET /group/{groupId}/scram-user-iteration Get scram user iteration
getScramUserSalt GET /group/{groupId}/scram-user-salt Get scram user salt
putScramUserIteration PUT /group/{groupId}/scram-user-iteration Write scram user iteration
putScramUserSalt PUT /group/{groupId}/scram-user-salt Write scram user salt

getScramComSendReceive

byte[] getScramComSendReceive(data)

Communication channel

encrypted communication ressource, for sending/receiving commands/responses after the SCRAM or CCOM session is established.

Example

let myService = new ScramService();
let data = BINARY_DATA_HERE; // byte[] | 

try{
    let call = myService.getScramComSendReceive(data);
    let value = (await call).body();
    console.log(`getScramComSendReceive: ${value}`);
}
catch (ex){
    // No response from device / response error (ie: device is not connected or request timeout)
    console.error(ex);
}
import com.iotize.android.device.device.api.service.definition.ScramService;

ServiceFactory serviceFactory = ...;
ScramService myService = serviceFactory.create(ScramService.class);


byte[] data = BINARY_DATA_HERE; // byte[] | 
try {
    Call<byte[]> call = myService.getScramComSendReceive(data);
    Response<byte[]> response = call.execute();
    if (response.isSuccessful()){
        System.out.println(response.body());
    }
    else{
        System.out.println(DeviceResponseError.createErrorMessage(response));
    }
} catch (ApiException e) {
    System.err.println("Exception when calling ScramService#getScramComSendReceive");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
data byte[](byte[].md)

Return type

byte[]

Authorization

No authorization required

getScramComStart

byte[] getScramComStart()

Start scram communication

Demande d'une clé aléatoire et initiation d'une session CCOM cryptée utilisant ce RNG comme clé de cryptage. Accessible uniquement en NFC.

Example

let myService = new ScramService();

try{
    let call = myService.getScramComStart();
    let value = (await call).body();
    console.log(`getScramComStart: ${value}`);
}
catch (ex){
    // No response from device / response error (ie: device is not connected or request timeout)
    console.error(ex);
}
import com.iotize.android.device.device.api.service.definition.ScramService;

ServiceFactory serviceFactory = ...;
ScramService myService = serviceFactory.create(ScramService.class);


try {
    Call<byte[]> call = myService.getScramComStart();
    Response<byte[]> response = call.execute();
    if (response.isSuccessful()){
        System.out.println(response.body());
    }
    else{
        System.out.println(DeviceResponseError.createErrorMessage(response));
    }
} catch (ApiException e) {
    System.err.println("Exception when calling ScramService#getScramComStart");
    e.printStackTrace();
}

Parameters

This endpoint does not need any parameter.

Return type

byte[]

Authorization

No authorization required

getScramHashIt

getScramHashIt()

Get scram hash it

Scram conf iteration counter (i) to be read by client before starting scram login process

Example

let myService = new ScramService();

try{
    let call = myService.getScramHashIt();
    let value = (await call).body();
    console.log(`getScramHashIt: ${value}`);
}
catch (ex){
    // No response from device / response error (ie: device is not connected or request timeout)
    console.error(ex);
}
import com.iotize.android.device.device.api.service.definition.ScramService;

ServiceFactory serviceFactory = ...;
ScramService myService = serviceFactory.create(ScramService.class);


try {
    Call<Void> call = myService.getScramHashIt();
    Response<Void> response = call.execute();
    if (response.isSuccessful()){
        System.out.println(response.body());
    }
    else{
        System.out.println(DeviceResponseError.createErrorMessage(response));
    }
} catch (ApiException e) {
    System.err.println("Exception when calling ScramService#getScramHashIt");
    e.printStackTrace();
}

Parameters

This endpoint does not need any parameter.

Return type

null (empty response body)

Authorization

No authorization required

getScramLogin

ScramLoginResponseBody getScramLogin(params)

First command to initiate scram login, for client to send login and nonce to IoTize, and IoTize to return user salt, user iteration counter (j) and combined nonce

First command to initiate scram login, for client to send login and nonce to IoTize, and IoTize to return user salt, user iteration counter (j) and combined nonce

Example

let myService = new ScramService();
let params = new ScramLoginParams(); // ScramLoginParams | 

try{
    let call = myService.getScramLogin(params);
    let value = (await call).body();
    console.log(`getScramLogin: ${value}`);
}
catch (ex){
    // No response from device / response error (ie: device is not connected or request timeout)
    console.error(ex);
}
import com.iotize.android.device.device.api.service.definition.ScramService;

ServiceFactory serviceFactory = ...;
ScramService myService = serviceFactory.create(ScramService.class);


ScramLoginParams params = new ScramLoginParams(); // ScramLoginParams | 
try {
    Call<ScramLoginResponseBody> call = myService.getScramLogin(params);
    Response<ScramLoginResponseBody> response = call.execute();
    if (response.isSuccessful()){
        System.out.println(response.body());
    }
    else{
        System.out.println(DeviceResponseError.createErrorMessage(response));
    }
} catch (ApiException e) {
    System.err.println("Exception when calling ScramService#getScramLogin");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
params ScramLoginParams(ScramLoginParams.md) [optional]

Return type

ScramLoginResponseBody

Authorization

No authorization required

getScramLoginProof

byte[] getScramLoginProof(params)

Scram login proof

Second command to finalize scram login, for client to send ClientProof and combined nonce

Example

let myService = new ScramService();
let params = BINARY_DATA_HERE; // byte[] | 

try{
    let call = myService.getScramLoginProof(params);
    let value = (await call).body();
    console.log(`getScramLoginProof: ${value}`);
}
catch (ex){
    // No response from device / response error (ie: device is not connected or request timeout)
    console.error(ex);
}
import com.iotize.android.device.device.api.service.definition.ScramService;

ServiceFactory serviceFactory = ...;
ScramService myService = serviceFactory.create(ScramService.class);


byte[] params = BINARY_DATA_HERE; // byte[] | 
try {
    Call<byte[]> call = myService.getScramLoginProof(params);
    Response<byte[]> response = call.execute();
    if (response.isSuccessful()){
        System.out.println(response.body());
    }
    else{
        System.out.println(DeviceResponseError.createErrorMessage(response));
    }
} catch (ApiException e) {
    System.err.println("Exception when calling ScramService#getScramLoginProof");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
params byte[](byte[].md) [optional]

Return type

byte[]

Authorization

No authorization required

getScramUserIteration

Integer getScramUserIteration(groupId)

Get scram user iteration

SCRAM Hash Iteration: Nombre d'itérations utilisé en SCRAM pour le dernier hashage. Nombre >1000, généré aléatoirement à l'écriture de la conf dans l'IoTize.

Example

let myService = new ScramService();
let groupId = 56; // Integer | Group id

try{
    let call = myService.getScramUserIteration(groupId);
    let value = (await call).body();
    console.log(`getScramUserIteration: ${value}`);
}
catch (ex){
    // No response from device / response error (ie: device is not connected or request timeout)
    console.error(ex);
}
import com.iotize.android.device.device.api.service.definition.ScramService;

ServiceFactory serviceFactory = ...;
ScramService myService = serviceFactory.create(ScramService.class);


Integer groupId = 56; // Integer | Group id
try {
    Call<Integer> call = myService.getScramUserIteration(groupId);
    Response<Integer> response = call.execute();
    if (response.isSuccessful()){
        System.out.println(response.body());
    }
    else{
        System.out.println(DeviceResponseError.createErrorMessage(response));
    }
} catch (ApiException e) {
    System.err.println("Exception when calling ScramService#getScramUserIteration");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
groupId Integer Group id

Return type

Integer

Authorization

No authorization required

getScramUserSalt

Integer getScramUserSalt(groupId)

Get scram user salt

User-specific salt utilisé (avec le User Name) pour saller les hashs du password StoredKey et ServerKey. Ecrit par Exec/SetPWD

Example

let myService = new ScramService();
let groupId = 56; // Integer | Group id

try{
    let call = myService.getScramUserSalt(groupId);
    let value = (await call).body();
    console.log(`getScramUserSalt: ${value}`);
}
catch (ex){
    // No response from device / response error (ie: device is not connected or request timeout)
    console.error(ex);
}
import com.iotize.android.device.device.api.service.definition.ScramService;

ServiceFactory serviceFactory = ...;
ScramService myService = serviceFactory.create(ScramService.class);


Integer groupId = 56; // Integer | Group id
try {
    Call<Integer> call = myService.getScramUserSalt(groupId);
    Response<Integer> response = call.execute();
    if (response.isSuccessful()){
        System.out.println(response.body());
    }
    else{
        System.out.println(DeviceResponseError.createErrorMessage(response));
    }
} catch (ApiException e) {
    System.err.println("Exception when calling ScramService#getScramUserSalt");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
groupId Integer Group id

Return type

Integer

Authorization

No authorization required

putScramUserIteration

putScramUserIteration(groupId, value)

Write scram user iteration

Example

let myService = new ScramService();
let groupId = 56; // Integer | Group id
let value = 56; // Integer | 

try{
    let call = myService.putScramUserIteration(groupId, value);
    let value = (await call).body();
    console.log(`putScramUserIteration: ${value}`);
}
catch (ex){
    // No response from device / response error (ie: device is not connected or request timeout)
    console.error(ex);
}
import com.iotize.android.device.device.api.service.definition.ScramService;

ServiceFactory serviceFactory = ...;
ScramService myService = serviceFactory.create(ScramService.class);


Integer groupId = 56; // Integer | Group id
Integer value = 56; // Integer | 
try {
    Call<Void> call = myService.putScramUserIteration(groupId, value);
    Response<Void> response = call.execute();
    if (response.isSuccessful()){
        System.out.println(response.body());
    }
    else{
        System.out.println(DeviceResponseError.createErrorMessage(response));
    }
} catch (ApiException e) {
    System.err.println("Exception when calling ScramService#putScramUserIteration");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
groupId Integer Group id
value Integer [optional]

Return type

null (empty response body)

Authorization

No authorization required

putScramUserSalt

putScramUserSalt(groupId, value)

Write scram user salt

Example

let myService = new ScramService();
let groupId = 56; // Integer | Group id to return
let value = 56; // Integer | 

try{
    let call = myService.putScramUserSalt(groupId, value);
    let value = (await call).body();
    console.log(`putScramUserSalt: ${value}`);
}
catch (ex){
    // No response from device / response error (ie: device is not connected or request timeout)
    console.error(ex);
}
import com.iotize.android.device.device.api.service.definition.ScramService;

ServiceFactory serviceFactory = ...;
ScramService myService = serviceFactory.create(ScramService.class);


Integer groupId = 56; // Integer | Group id to return
Integer value = 56; // Integer | 
try {
    Call<Void> call = myService.putScramUserSalt(groupId, value);
    Response<Void> response = call.execute();
    if (response.isSuccessful()){
        System.out.println(response.body());
    }
    else{
        System.out.println(DeviceResponseError.createErrorMessage(response));
    }
} catch (ApiException e) {
    System.err.println("Exception when calling ScramService#putScramUserSalt");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
groupId Integer Group id to return
value Integer [optional]

Return type

null (empty response body)

Authorization

No authorization required