Class: Store

$.security. Store

The secure store API can be used to securely store data in name/value form. Applications can define a secure store object file and refer to this design time object in the application coding. The XSEngine takes care of the encryption and decryption and also provides the persistency for the data. There are two visibility options for the data a) Visible application wide All users of the application share the same data and can decrypt/encrypt data e.g.: passwords for a remote system b) Visible application wide but with a seperation on user level Every user of the application can have it's own encrypted data which can only be decrypted by the user himself e.g. credit card numbers/pin codes etc.

new Store(secureStoreFile)

Parameters:
Name Type Description
secureStoreFile string The location of the xssecurestore file
Examples
// content of the xssecurestore file localStore.xssecurestore
{}
function store() {
  var config = {
    name: "foo",
    value: "bar"
  };

  var aStore = new $.security.Store("localStore.xssecurestore");
  aStore.store(config);
}

function read() {
  var config = {
    name: "foo"
  };

  try {
    var store = new $.security.Store("localStore.xssecurestore");
    var value = store.read(config);
  }
  catch(ex) {
    //do some error handling
  }
}

Methods

read(parameters) → {string}

read values, accessible by all users of the application
Parameters:
Name Type Description
parameters $.security.Store~ReadParameters parameter object
Throws:
Throws an error if the access fails or the parameters are invalid
Returns:
The decrypted value
Type
string

readForUser(parameters) → {string}

read values on user isolation level
Parameters:
Name Type Description
parameters $.security.Store~ReadParameters parameter object
Throws:
Throws an error if the access or the parameters are invalid
Returns:
The decrypted value
Type
string

remove(parameters)

remove values on application isolation level
Parameters:
Name Type Description
parameters $.security.Store~DeletionParameters parameter object
Throws:
Throws an error if the access or the parameters are invalid

removeForUser(parameters)

remove values on user isolation level
Parameters:
Name Type Description
parameters $.security.Store~DeletionParameters parameter object
Throws:
Throws an error if the access or the parameters are invalid

store(parameters)

read values on user isolation level
Parameters:
Name Type Description
parameters $.security.Store~WriteParameters parameter object
Throws:
Throws an error if the access or the parameters are invalid

storeForUser(parameters)

stores user specific values, no other user can decrypt it
Parameters:
Name Type Description
parameters $.security.Store~WriteParameters parameter object
Throws:
Throws an error if the access or the parameters are invalid

Type Definitions

DeletionParameters

Type:
  • object
Properties:
Name Type Description
name string Identifier for the data to be stored

ReadParameters

Type:
  • object
Properties:
Name Type Description
name string Identifier for the data to be stored

WriteParameters

Type:
  • object
Properties:
Name Type Description
name string Identifier for the data to be stored
value string The data which shall be stored