This repository was archived by the owner on Aug 5, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 310
API
Lilia edited this page Jun 7, 2016
·
14 revisions
Constructs a new SignalProtocolAddress.
| Parameter | Type | Description |
|---|---|---|
number |
String | The storage interface. |
deviceId |
Number | Remote address |
Constructs a new SignalProtocolAddress from a string.
| Parameter | Type | Description |
|---|---|---|
str |
String |
| Parameter | Type | Description |
|---|---|---|
| returns | String |
| Parameter | Type | Description |
|---|---|---|
| returns | Number |
Convert the address into it's string form.
| Parameter | Type | Description |
|---|---|---|
| returns | String |
Compares one address to another.
| Parameter | Type | Description |
|---|---|---|
| returns | Boolean |
Constructs a new SessionBuilder.
| Parameter | Type | Description |
|---|---|---|
store |
SignalProtocolStore | A storage interface |
address |
SignalProtocolAddress | A remote address |
Create a new session from a PreKey bundle returned by the server.
| Parameter | Type | Description |
|---|---|---|
| preKeyBundle | Object | { registrationId: <Number>, identityKey: <ArrayBuffer>, signedPreKey: { keyId: <Number>, publicKey: <ArrayBuffer>, signature: <ArrayBuffer> }, preKey: { keyId: <Number>, publicKey : <ArrayBuffer> } } |
| returns | Promise |
Construct a new session from a preKeyWhisperMessage. Modifies the given record object but does not save the change to the store. This method is not used in practice, as it is automatically called internally by decryptPreKeyWhisperMessage.
| Parameter | Type | Description |
|---|---|---|
| record | SessionRecord | |
| preKeyWhisperMessage | PreKeyWhisperMessage | |
| returns | Promise |
Constructs a new SessionCipher.
| Parameter | Type | Description |
|---|---|---|
store |
SignalProtocolStore | A storage interface |
address |
SignalProtocolAddress | A remote address |
Encrypt a message to the cipher's address.
| Parameter | Type | Description |
|---|---|---|
| message | ByteBuffer | ArrayBuffer | Uint8Array | String | Anything that can be wrapped by a ByteBuffer |
| encoding | String | String encoding if message is a string ("base64", "hex", "binary", defaults to "utf8") |
| returns | Promise | resolves to object: {type: <Number>, body: <String>}
|
Decrypt a normal message.
| Parameter | Type | Description |
|---|---|---|
| message | ByteBuffer | ArrayBuffer | Uint8Array | String | Anything that can be wrapped by a ByteBuffer |
| encoding | String | String encoding if message is a string ("base64", "hex", "binary", defaults to "utf8") |
| returns | Promise | resolves to ArrayBuffer |
Decrypt a PreKey message.
| Parameter | Type | Description |
|---|---|---|
| message | ByteBuffer | ArrayBuffer | Uint8Array | String | Anything that can be wrapped by a ByteBuffer |
| encoding | String | String encoding if message is a string ("base64", "hex", "binary", defaults to "utf8") |
| returns | Promise | resolves to ArrayBuffer |