ContactPromise
A stub class that doesn't actually get used, but helps with autocompletion. Allows you to use Contacts asynchronously.
Method Summary
Public Methods | ||
public |
catch(err: Function): ContactPromise |
|
public |
clean(extra: *): ContactPromise |
|
public |
compute(key: String | Buffer | Array): ContactPromise Computes the private key for a contact from an input key. |
|
public |
export(extra: Object): ContactPromise Used to export the (safe) JSON for the Contact |
|
public |
Sends the data to the recipient, encrypted. |
|
public |
privateKey(): ContactPromise<bigInt> Returns the private key |
|
public |
publicKey(): ContactPromise<bigInt> Returns the public key |
|
public |
Sends the data to the recipient, encrypted. |
|
public |
sign(data: *, bundle: Boolean): ContactPromise Signs data using the Contact, using the Schnorr Signature algorithm. |
|
public |
then(data: Function): ContactPromise |
|
public |
verify(data: Object | Promise.<Object>=, source: Object | Promise.<Object>=): ContactPromise Verifies the signed data. |
Public Methods
public catch(err: Function): ContactPromise source
Params:
Name | Type | Attribute | Description |
err | Function |
public clean(extra: *): ContactPromise source
Params:
Name | Type | Attribute | Description |
extra | * |
public compute(key: String | Buffer | Array): ContactPromise source
Computes the private key for a contact from an input key.
public export(extra: Object): ContactPromise source
Used to export the (safe) JSON for the Contact
Params:
Name | Type | Attribute | Description |
extra | Object |
public open(data: *): Promise<Object> source
Sends the data to the recipient, encrypted.
Params:
Name | Type | Attribute | Description |
data | * |
public send(recipient: Contact, data: *): Promise<Object> source
Sends the data to the recipient, encrypted.
Params:
Name | Type | Attribute | Description |
recipient | Contact | ||
data | * |
public sign(data: *, bundle: Boolean): ContactPromise source
Signs data using the Contact, using the Schnorr Signature algorithm.
This is not how DiscreteCrypt (C++) does it,
but it will be modified to match this approach.
Params:
Name | Type | Attribute | Description |
data | * | ||
bundle | Boolean |
public then(data: Function): ContactPromise source
Params:
Name | Type | Attribute | Description |
data | Function |
public verify(data: Object | Promise.<Object>=, source: Object | Promise.<Object>=): ContactPromise source
Verifies the signed data.