Core functionality to interact with TangleID. Includes methods for:
- Registering and resolving identifier
- Signing JSON-LD document
- Verifying JSON-LD document signature
Install using npm:
npm install @tangleid/core
or using yarn:
yarn add @tangleid/core
Param | Type | Default | Description |
---|---|---|---|
[settings] | object |
{} |
Connection settings |
[params.provider] | object |
Uri of IRI node. |
Composes API object from it's components
Param | Type | Description |
---|---|---|
seed | string |
The seed of the MAM channel. |
publicKeys | Array.<string> |
PEM-formatted public Keys. |
Publish the DID document to the MAM channel with specific Tangle network.
Returns: Promise.<object>
- Promise object represents the result. The result
conatains DID did
and DID document document
.
Param | Type | Description |
---|---|---|
did | string |
The DID of DID document. |
Fetch DID document by DID.
Returns: Promise.<object>
- Promise object represents the
DID Document.
Param | Type | Description |
---|---|---|
document | object |
JSON-LD document to be signed. |
publicKey | PublicKeyMeta |
Public key metadata. |
privateKeyPem | string |
PEM-formatted private key. |
Sign JSON-LD document with RSA signature suite.
Returns: Promise.<object>
- Promise object represents signed JSON-LD document.
Param | Type | Description |
---|---|---|
document | object |
JSON-LD document to be verify. |
Verify JSON-LD document signature.
Returns: Promise.<boolean>
- Promise object represents verification result.