Skip to main content
Version: 6.3.0

Security

Security management API allows you to manually set PIN code interfaces or get current PIN code.

All methods

MethodsDescriptionSupported since
getPinCode()Get PIN code, 4 digits number string4.1
setPinCode()Set PIN code, 4 digits number string4.1
generateRandomPinCode()Generate 4 digits number string and set it as PIN code4.1

getPinCode()

Method getPinCode() will returns current PIN code, 4 digits number string.

await sos.management.security.getPinCode(); // Returns e.g. "1234"

setPinCode()

Method setPinCode() will set the current PIN code, 4 digits number string. PIN code 0000 is not allowed according to the default PIN after boot when the device is not connected to the internet!

ParamTypeRequiredDescription
pinCodeString
Yes
Set new PIN code

Javascript example

await sos.management.security.setPinCode("9999");

generateRandomPinCode()

Method generateRandomPinCode() will generate random 4 digits number string and set it as current PIN code.

Javascript example

await sos.management.security.generateRandomPinCode(); // Generate new random PIN code
const newPinCode = await sos.management.security.getPinCode(); // Get PIN code as string
console.log(newPinCode);

Errors

Although we are doing our best, following errors may occur when working with the Applet Resources.

CodeTypeMessage
41701AppletSecurityErrorInvalid PIN code (has to be 4 digits string)
41702AppletSecurityErrorNot allowed PIN code 0000, use another pin code
41703AppletSecurityErrorGet PIN code failed because was not set yet. Try to get PIN code later or set the PIN code using setPinCode method first.