Skip to content

ScramService

Method LWM2M request Description
getScramHashIt GET /1024//42
alias: /scram/scram/hash-it
Get scram hash it
getScramUserIteration GET /1025/{groupId}/7
alias: /group/{groupId}/scram-user-iteration
Get scram user iteration
getScramUserSalt GET /1025/{groupId}/16
alias: /group/{groupId}/scram-user-salt
Get scram user salt
initialize GET /1024//47
alias: /scram/initialize
Start scram communication
login GET /1024//40
alias: /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
loginProof GET /1024//41
alias: /scram/login-proof
Scram login proof
putScramUserIteration PUT /1025/{groupId}/7
alias: /group/{groupId}/scram-user-iteration
Write scram user iteration
putScramUserSalt PUT /1025/{groupId}/16
alias: /group/{groupId}/scram-user-salt
Write scram user salt
send GET /1024//48
alias: /scram/com-send-receive
Communication channel

getScramHashIt

Minimal Tap Firmware version: >= 1.11

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 .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();
}
import TapDeviceClient
let tap: TapDevice = // ...

let ApiResponse<Any> = try tap.service.scram.getScramHashIt();
print("Response:" + response.body())

Parameters

This endpoint does not need any parameter.

Return type

null (empty response body)

Authorization

No authorization required

getScramUserIteration

Minimal Tap Firmware version: >= 1.0

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 .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();
}
import TapDeviceClient
let tap: TapDevice = // ...

let ApiResponse<Integer> = try tap.service.groupscram.getScramUserIteration(groupId);
print("Response:" + response.body())

Parameters

Name Type Description Notes
groupId Integer Group id

Return type

Integer

Authorization

No authorization required

getScramUserSalt

Minimal Tap Firmware version: >= 1.0

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 .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();
}
import TapDeviceClient
let tap: TapDevice = // ...

let ApiResponse<Integer> = try tap.service.groupscram.getScramUserSalt(groupId);
print("Response:" + response.body())

Parameters

Name Type Description Notes
groupId Integer Group id

Return type

Integer

Authorization

No authorization required

initialize

Minimal Tap Firmware version: >= 1.11

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.initialize();
    let value = (await call).body();
    console.log(`initialize: ${value}`);
}
catch (ex){
    // No response from device / response error (ie: device is not connected or request timeout)
    console.error(ex);
}
import .ScramService;

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


try {
    Call<Bytes> call = myService.initialize();
    Response<Bytes> 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#initialize");
    e.printStackTrace();
}
import TapDeviceClient
let tap: TapDevice = // ...

let ApiResponse<Bytes> = try tap.service.scram.initialize();
print("Response:" + response.body())

Parameters

This endpoint does not need any parameter.

Return type

Bytes

Authorization

No authorization required

login

Minimal Tap Firmware version: >= 1.0

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 = ; // ScramLoginParams | 

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

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


ScramLoginParams params = ; // ScramLoginParams | 
try {
    Call<ScramLoginResponseBody> call = myService.login(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#login");
    e.printStackTrace();
}
import TapDeviceClient
let tap: TapDevice = // ...

let ApiResponse<ScramLoginResponseBody> = try tap.service.scram.login(params);
print("Response:" + response.body())

Parameters

Name Type Description Notes
params ScramLoginParamsScramLoginParams [optional]

Return type

ScramLoginResponseBody

Authorization

No authorization required

loginProof

Minimal Tap Firmware version: >= 1.0

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; // Bytes | 

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

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


Bytes params = BINARY_DATA_HERE; // Bytes | 
try {
    Call<Bytes> call = myService.loginProof(params);
    Response<Bytes> 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#loginProof");
    e.printStackTrace();
}
import TapDeviceClient
let tap: TapDevice = // ...

let ApiResponse<Bytes> = try tap.service.scram.loginProof(params);
print("Response:" + response.body())

Parameters

Name Type Description Notes
params BytesBytes [optional]

Return type

Bytes

Authorization

No authorization required

putScramUserIteration

Minimal Tap Firmware version: >= 1.0

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 .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();
}
import TapDeviceClient
let tap: TapDevice = // ...

let ApiResponse<Any> = try tap.service.groupscram.putScramUserIteration(groupId, value);
print("Response:" + response.body())

Parameters

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

Return type

null (empty response body)

Authorization

No authorization required

putScramUserSalt

Minimal Tap Firmware version: >= 1.0

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 .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();
}
import TapDeviceClient
let tap: TapDevice = // ...

let ApiResponse<Any> = try tap.service.groupscram.putScramUserSalt(groupId, value);
print("Response:" + response.body())

Parameters

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

Return type

null (empty response body)

Authorization

No authorization required

send

Minimal Tap Firmware version: >= 1.11

Communication channel

Crypted 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; // Bytes | 

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

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


Bytes data = BINARY_DATA_HERE; // Bytes | 
try {
    Call<Bytes> call = myService.send(data);
    Response<Bytes> 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#send");
    e.printStackTrace();
}
import TapDeviceClient
let tap: TapDevice = // ...

let ApiResponse<Bytes> = try tap.service.scram.send(data);
print("Response:" + response.body())

Parameters

Name Type Description Notes
data BytesBytes

Return type

Bytes

Authorization

No authorization required