Security

Security

Class that provides security functionality through the pc-ble-driver-js AddOn.

Constructor

new Security(bleDriver)

Create a wrapper to the security functionality of the underlying BLE driver.
Source:
Parameters:
Name Type Description
bleDriver The underlying BLE driver `pc-ble-driver-js-sd_api_v` called with bindings.

Methods

generateKeyPair() → {Object}

Method that generates a public/private key pair where the public key is to be distributed.
Source:
Returns:
Type:
Object
The public private key pair. TODO: double check this.

generatePublicKey(privateKey) → {string}

Method that generates a public key.
Source:
Parameters:
Name Type Description
privateKey string The private key that should be used to generate the public key.
Returns:
Type:
string
The generated public key.

generateSharedSecret(privateKey, publicKey) → {string}

Method that generates a shared secret.
Source:
Parameters:
Name Type Description
privateKey string The private key that should be used to generate the shared secret.
publicKey string The public key that should be used to generate the shared secret.
Returns:
Type:
string
The generated shared secret.