Skip to content

Commit

Permalink
merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
UMR1352 committed Mar 19, 2024
1 parent 6003cf0 commit bdf6b54
Show file tree
Hide file tree
Showing 14 changed files with 380 additions and 79 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

## Introduction

IOTA Identity is a [Rust](https://www.rust-lang.org/) implementation of decentralized digital identity, also known as Self-Sovereign Identity (SSI). It implements the W3C [Decentralized Identifiers (DID)](https://www.w3.org/TR/did-core/) and [Verifiable Credentials](https://www.w3.org/TR/vc-data-model/) specifications. This library can be used to create, resolve and authenticate digital identities and to create verifiable credentials and presentations in order to share information in a verifiable manner and establish trust in the digital world. It does so while supporting secure storage of cryptographic keys, which can be implemented for your preferred key management system. Many of the individual libraries (Rust crates) are agnostic over the concrete DID method, with the exception of some libraries dedicated to implement the [IOTA DID method](https://wiki.iota.org/shimmer/identity.rs/specs/did/iota_did_method_spec/), which is an implementation of decentralized digital identity on the IOTA and Shimmer networks. Written in stable Rust, IOTA Identity has strong guarantees of memory safety and process integrity while maintaining exceptional performance.
IOTA Identity is a [Rust](https://www.rust-lang.org/) implementation of decentralized digital identity, also known as Self-Sovereign Identity (SSI). It implements the W3C [Decentralized Identifiers (DID)](https://www.w3.org/TR/did-core/) and [Verifiable Credentials](https://www.w3.org/TR/vc-data-model/) specifications. This library can be used to create, resolve and authenticate digital identities and to create verifiable credentials and presentations in order to share information in a verifiable manner and establish trust in the digital world. It does so while supporting secure storage of cryptographic keys, which can be implemented for your preferred key management system. Many of the individual libraries (Rust crates) are agnostic over the concrete DID method, with the exception of some libraries dedicated to implement the [IOTA DID method](https://wiki.iota.org/identity.rs/specs/did/iota_did_method_spec/), which is an implementation of decentralized digital identity on the IOTA and Shimmer networks. Written in stable Rust, IOTA Identity has strong guarantees of memory safety and process integrity while maintaining exceptional performance.

## Bindings

Expand All @@ -36,8 +36,8 @@ IOTA Identity is a [Rust](https://www.rust-lang.org/) implementation of decentra

- API References:
- [Rust API Reference](https://docs.rs/identity_iota/latest/identity_iota/): Package documentation (cargo docs).
- [Wasm API Reference](https://wiki.iota.org/shimmer/identity.rs/libraries/wasm/api_reference/): Wasm Package documentation.
- [Identity Documentation Pages](https://wiki.iota.org/shimmer/identity.rs/introduction): Supplementing documentation with context around identity and simple examples on library usage.
- [Wasm API Reference](https://wiki.iota.org/identity.rs/libraries/wasm/api_reference/): Wasm Package documentation.
- [Identity Documentation Pages](https://wiki.iota.org/identity.rs/introduction): Supplementing documentation with context around identity and simple examples on library usage.
- [Examples](https://github.com/iotaledger/identity.rs/blob/HEAD/examples): Practical code snippets to get you started with the library.

## Prerequisites
Expand Down Expand Up @@ -238,7 +238,7 @@ For detailed development progress, see the IOTA Identity development [kanban boa

We would love to have you help us with the development of IOTA Identity. Each and every contribution is greatly valued!

Please review the [contribution](https://wiki.iota.org/shimmer/identity.rs/contribute) and [workflow](https://wiki.iota.org/shimmer/identity.rs/workflow) sections in the [IOTA Wiki](https://wiki.iota.org/).
Please review the [contribution](https://wiki.iota.org/identity.rs/contribute) and [workflow](https://wiki.iota.org/identity.rs/workflow) sections in the [IOTA Wiki](https://wiki.iota.org/).

To contribute directly to the repository, simply fork the project, push your changes to your fork and create a pull request to get them included!

Expand Down
185 changes: 131 additions & 54 deletions bindings/wasm/docs/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ if the object is being concurrently modified.</p>
</dd>
<dt><a href="#Credential">Credential</a></dt>
<dd></dd>
<dt><a href="#CustomMethodData">CustomMethodData</a></dt>
<dd><p>A custom verification method data format.</p>
</dd>
<dt><a href="#DIDUrl">DIDUrl</a></dt>
<dd><p>A method agnostic DID Url.</p>
</dd>
Expand Down Expand Up @@ -187,8 +190,9 @@ working with storage backed DID documents.</p>
## Members

<dl>
<dt><a href="#CredentialStatus">CredentialStatus</a></dt>
<dd></dd>
<dt><a href="#StatusPurpose">StatusPurpose</a></dt>
<dd><p>Purpose of a <a href="#StatusList2021">StatusList2021</a>.</p>
</dd>
<dt><a href="#SubjectHolderRelationship">SubjectHolderRelationship</a></dt>
<dd><p>Declares how credential subjects must relate to the presentation holder.</p>
<p>See also the <a href="https://www.w3.org/TR/vc-data-model/#subject-holder-relationships">Subject-Holder Relationship</a> section of the specification.</p>
Expand All @@ -203,9 +207,8 @@ This variant is the default.</p>
<dt><a href="#Any">Any</a></dt>
<dd><p>The holder is not required to have any kind of relationship to any credential subject.</p>
</dd>
<dt><a href="#StatusPurpose">StatusPurpose</a></dt>
<dd><p>Purpose of a <a href="#StatusList2021">StatusList2021</a>.</p>
</dd>
<dt><a href="#StateMetadataEncoding">StateMetadataEncoding</a></dt>
<dd></dd>
<dt><a href="#FailFast">FailFast</a></dt>
<dd><p>Declares when validation should return if an error occurs.</p>
</dd>
Expand All @@ -215,6 +218,10 @@ This variant is the default.</p>
<dt><a href="#FirstError">FirstError</a></dt>
<dd><p>Return after the first error occurs.</p>
</dd>
<dt><a href="#MethodRelationship">MethodRelationship</a></dt>
<dd></dd>
<dt><a href="#CredentialStatus">CredentialStatus</a></dt>
<dd></dd>
<dt><a href="#StatusCheck">StatusCheck</a></dt>
<dd><p>Controls validation behaviour when checking whether or not a credential has been revoked by its
<a href="https://www.w3.org/TR/vc-data-model/#status"><code>credentialStatus</code></a>.</p>
Expand All @@ -232,18 +239,11 @@ This variant is the default.</p>
<dt><a href="#SkipAll">SkipAll</a></dt>
<dd><p>Skip all status checks.</p>
</dd>
<dt><a href="#StateMetadataEncoding">StateMetadataEncoding</a></dt>
<dd></dd>
<dt><a href="#MethodRelationship">MethodRelationship</a></dt>
<dd></dd>
</dl>

## Functions

<dl>
<dt><a href="#start">start()</a></dt>
<dd><p>Initializes the console error panic hook for better error messages</p>
</dd>
<dt><a href="#verifyEd25519">verifyEd25519(alg, signingInput, decodedSignature, publicKey)</a></dt>
<dd><p>Verify a JWS signature secured with the <code>EdDSA</code> algorithm and curve <code>Ed25519</code>.</p>
<p>This function is useful when one is composing a <code>IJwsVerifier</code> that delegates
Expand All @@ -258,6 +258,9 @@ prior to calling the function.</p>
<dt><a href="#decodeB64">decodeB64(data)</a> ⇒ <code>Uint8Array</code></dt>
<dd><p>Decode the given url-safe base64-encoded slice into its raw bytes.</p>
</dd>
<dt><a href="#start">start()</a></dt>
<dd><p>Initializes the console error panic hook for better error messages</p>
</dd>
</dl>

<a name="CoreDID"></a>
Expand Down Expand Up @@ -1138,6 +1141,53 @@ Deserializes an instance from a JSON object.
| --- | --- |
| json | <code>any</code> |

<a name="CustomMethodData"></a>

## CustomMethodData
A custom verification method data format.

**Kind**: global class

* [CustomMethodData](#CustomMethodData)
* [new CustomMethodData(name, data)](#new_CustomMethodData_new)
* _instance_
* [.clone()](#CustomMethodData+clone)[<code>CustomMethodData</code>](#CustomMethodData)
* [.toJSON()](#CustomMethodData+toJSON) ⇒ <code>any</code>
* _static_
* [.fromJSON(json)](#CustomMethodData.fromJSON)[<code>CustomMethodData</code>](#CustomMethodData)

<a name="new_CustomMethodData_new"></a>

### new CustomMethodData(name, data)

| Param | Type |
| --- | --- |
| name | <code>string</code> |
| data | <code>any</code> |

<a name="CustomMethodData+clone"></a>

### customMethodData.clone() ⇒ [<code>CustomMethodData</code>](#CustomMethodData)
Deep clones the object.

**Kind**: instance method of [<code>CustomMethodData</code>](#CustomMethodData)
<a name="CustomMethodData+toJSON"></a>

### customMethodData.toJSON() ⇒ <code>any</code>
Serializes this to a JSON object.

**Kind**: instance method of [<code>CustomMethodData</code>](#CustomMethodData)
<a name="CustomMethodData.fromJSON"></a>

### CustomMethodData.fromJSON(json) ⇒ [<code>CustomMethodData</code>](#CustomMethodData)
Deserializes an instance from a JSON object.

**Kind**: static method of [<code>CustomMethodData</code>](#CustomMethodData)

| Param | Type |
| --- | --- |
| json | <code>any</code> |

<a name="DIDUrl"></a>

## DIDUrl
Expand Down Expand Up @@ -1967,7 +2017,7 @@ if the object is being concurrently modified.
* _instance_
* [.id()](#IotaDocument+id)[<code>IotaDID</code>](#IotaDID)
* [.controller()](#IotaDocument+controller)[<code>Array.&lt;IotaDID&gt;</code>](#IotaDID)
* [.setController(controllers)](#IotaDocument+setController)
* [.setController(controller)](#IotaDocument+setController)
* [.alsoKnownAs()](#IotaDocument+alsoKnownAs) ⇒ <code>Array.&lt;string&gt;</code>
* [.setAlsoKnownAs(urls)](#IotaDocument+setAlsoKnownAs)
* [.properties()](#IotaDocument+properties) ⇒ <code>Map.&lt;string, any&gt;</code>
Expand Down Expand Up @@ -2042,7 +2092,7 @@ during resolution and are omitted when publishing.
**Kind**: instance method of [<code>IotaDocument</code>](#IotaDocument)
<a name="IotaDocument+setController"></a>

### iotaDocument.setController(controllers)
### iotaDocument.setController(controller)
Sets the controllers of the document.

Note: Duplicates will be ignored.
Expand All @@ -2052,7 +2102,7 @@ Use `null` to remove all controllers.

| Param | Type |
| --- | --- |
| controllers | [<code>CoreDID</code>](#CoreDID) \| [<code>Array.&lt;CoreDID&gt;</code>](#CoreDID) \| <code>null</code> |
| controller | [<code>Array.&lt;IotaDID&gt;</code>](#IotaDID) \| <code>null</code> |

<a name="IotaDocument+alsoKnownAs"></a>

Expand Down Expand Up @@ -4343,6 +4393,7 @@ Supported verification method data formats.

* [MethodData](#MethodData)
* _instance_
* [.tryCustom()](#MethodData+tryCustom)[<code>CustomMethodData</code>](#CustomMethodData)
* [.tryDecode()](#MethodData+tryDecode) ⇒ <code>Uint8Array</code>
* [.tryPublicKeyJwk()](#MethodData+tryPublicKeyJwk)[<code>Jwk</code>](#Jwk)
* [.toJSON()](#MethodData+toJSON) ⇒ <code>any</code>
Expand All @@ -4351,8 +4402,15 @@ Supported verification method data formats.
* [.newBase58(data)](#MethodData.newBase58)[<code>MethodData</code>](#MethodData)
* [.newMultibase(data)](#MethodData.newMultibase)[<code>MethodData</code>](#MethodData)
* [.newJwk(key)](#MethodData.newJwk)[<code>MethodData</code>](#MethodData)
* [.newCustom(name, data)](#MethodData.newCustom)[<code>MethodData</code>](#MethodData)
* [.fromJSON(json)](#MethodData.fromJSON)[<code>MethodData</code>](#MethodData)

<a name="MethodData+tryCustom"></a>

### methodData.tryCustom() ⇒ [<code>CustomMethodData</code>](#CustomMethodData)
Returns the wrapped custom method data format is `Custom`.

**Kind**: instance method of [<code>MethodData</code>](#MethodData)
<a name="MethodData+tryDecode"></a>

### methodData.tryDecode() ⇒ <code>Uint8Array</code>
Expand Down Expand Up @@ -4419,6 +4477,18 @@ An error is thrown if the given `key` contains any private components.
| --- | --- |
| key | [<code>Jwk</code>](#Jwk) |

<a name="MethodData.newCustom"></a>

### MethodData.newCustom(name, data) ⇒ [<code>MethodData</code>](#MethodData)
Creates a new custom [MethodData](#MethodData).

**Kind**: static method of [<code>MethodData</code>](#MethodData)

| Param | Type |
| --- | --- |
| name | <code>string</code> |
| data | <code>any</code> |

<a name="MethodData.fromJSON"></a>

### MethodData.fromJSON(json) ⇒ [<code>MethodData</code>](#MethodData)
Expand Down Expand Up @@ -4570,6 +4640,7 @@ Supported verification method types.
* [.Ed25519VerificationKey2018()](#MethodType.Ed25519VerificationKey2018)[<code>MethodType</code>](#MethodType)
* [.X25519KeyAgreementKey2019()](#MethodType.X25519KeyAgreementKey2019)[<code>MethodType</code>](#MethodType)
* [.JsonWebKey()](#MethodType.JsonWebKey)[<code>MethodType</code>](#MethodType)
* [.custom(type_)](#MethodType.custom)[<code>MethodType</code>](#MethodType)
* [.fromJSON(json)](#MethodType.fromJSON)[<code>MethodType</code>](#MethodType)

<a name="MethodType+toString"></a>
Expand Down Expand Up @@ -4605,6 +4676,17 @@ A verification method for use with JWT verification as prescribed by the [Jwk](#
in the `publicKeyJwk` entry.

**Kind**: static method of [<code>MethodType</code>](#MethodType)
<a name="MethodType.custom"></a>

### MethodType.custom(type_) ⇒ [<code>MethodType</code>](#MethodType)
A custom method.

**Kind**: static method of [<code>MethodType</code>](#MethodType)

| Param | Type |
| --- | --- |
| type_ | <code>string</code> |

<a name="MethodType.fromJSON"></a>

### MethodType.fromJSON(json) ⇒ [<code>MethodType</code>](#MethodType)
Expand Down Expand Up @@ -5006,11 +5088,9 @@ Representation of an SD-JWT of the format
* [.jwt()](#SdJwt+jwt) ⇒ <code>string</code>
* [.disclosures()](#SdJwt+disclosures) ⇒ <code>Array.&lt;string&gt;</code>
* [.keyBindingJwt()](#SdJwt+keyBindingJwt) ⇒ <code>string</code> \| <code>undefined</code>
* [.toJSON()](#SdJwt+toJSON) ⇒ <code>any</code>
* [.clone()](#SdJwt+clone)[<code>SdJwt</code>](#SdJwt)
* _static_
* [.parse(sd_jwt)](#SdJwt.parse)[<code>SdJwt</code>](#SdJwt)
* [.fromJSON(json)](#SdJwt.fromJSON)[<code>SdJwt</code>](#SdJwt)

<a name="new_SdJwt_new"></a>

Expand Down Expand Up @@ -5053,12 +5133,6 @@ The disclosures part.
### sdJwt.keyBindingJwt() ⇒ <code>string</code> \| <code>undefined</code>
The optional key binding JWT.

**Kind**: instance method of [<code>SdJwt</code>](#SdJwt)
<a name="SdJwt+toJSON"></a>

### sdJwt.toJSON() ⇒ <code>any</code>
Serializes this to a JSON object.

**Kind**: instance method of [<code>SdJwt</code>](#SdJwt)
<a name="SdJwt+clone"></a>

Expand All @@ -5080,17 +5154,6 @@ Returns `DeserializationError` if parsing fails.
| --- | --- |
| sd_jwt | <code>string</code> |

<a name="SdJwt.fromJSON"></a>

### SdJwt.fromJSON(json) ⇒ [<code>SdJwt</code>](#SdJwt)
Deserializes an instance from a JSON object.

**Kind**: static method of [<code>SdJwt</code>](#SdJwt)

| Param | Type |
| --- | --- |
| json | <code>any</code> |

<a name="SdJwtCredentialValidator"></a>

## SdJwtCredentialValidator
Expand Down Expand Up @@ -5967,6 +6030,7 @@ A DID Document Verification Method.
**Kind**: global class
* [VerificationMethod](#VerificationMethod)
* [new VerificationMethod(id, controller, type_, data)](#new_VerificationMethod_new)
* _instance_
* [.id()](#VerificationMethod+id) ⇒ [<code>DIDUrl</code>](#DIDUrl)
* [.setId(id)](#VerificationMethod+setId)
Expand All @@ -5984,6 +6048,19 @@ A DID Document Verification Method.
* [.newFromJwk(did, key, [fragment])](#VerificationMethod.newFromJwk) ⇒ [<code>VerificationMethod</code>](#VerificationMethod)
* [.fromJSON(json)](#VerificationMethod.fromJSON) ⇒ [<code>VerificationMethod</code>](#VerificationMethod)
<a name="new_VerificationMethod_new"></a>
### new VerificationMethod(id, controller, type_, data)
Create a custom [VerificationMethod](#VerificationMethod).
| Param | Type |
| --- | --- |
| id | [<code>DIDUrl</code>](#DIDUrl) |
| controller | [<code>CoreDID</code>](#CoreDID) |
| type_ | [<code>MethodType</code>](#MethodType) |
| data | [<code>MethodData</code>](#MethodData) |
<a name="VerificationMethod+id"></a>
### verificationMethod.id() ⇒ [<code>DIDUrl</code>](#DIDUrl)
Expand Down Expand Up @@ -6119,9 +6196,11 @@ Deserializes an instance from a JSON object.
| --- | --- |
| json | <code>any</code> |
<a name="CredentialStatus"></a>
<a name="StatusPurpose"></a>
## StatusPurpose
Purpose of a [StatusList2021](#StatusList2021).
## CredentialStatus
**Kind**: global variable
<a name="SubjectHolderRelationship"></a>
Expand Down Expand Up @@ -6150,11 +6229,9 @@ The holder must match the subject only for credentials where the [`nonTransferab
The holder is not required to have any kind of relationship to any credential subject.
**Kind**: global variable
<a name="StatusPurpose"></a>
## StatusPurpose
Purpose of a [StatusList2021](#StatusList2021).
<a name="StateMetadataEncoding"></a>
## StateMetadataEncoding
**Kind**: global variable
<a name="FailFast"></a>
Expand All @@ -6173,6 +6250,14 @@ Return all errors that occur during validation.
## FirstError
Return after the first error occurs.
**Kind**: global variable
<a name="MethodRelationship"></a>
## MethodRelationship
**Kind**: global variable
<a name="CredentialStatus"></a>
## CredentialStatus
**Kind**: global variable
<a name="StatusCheck"></a>
Expand Down Expand Up @@ -6205,20 +6290,6 @@ Validate the status if supported, skip any unsupported
Skip all status checks.
**Kind**: global variable
<a name="StateMetadataEncoding"></a>
## StateMetadataEncoding
**Kind**: global variable
<a name="MethodRelationship"></a>
## MethodRelationship
**Kind**: global variable
<a name="start"></a>
## start()
Initializes the console error panic hook for better error messages
**Kind**: global function
<a name="verifyEd25519"></a>
## verifyEd25519(alg, signingInput, decodedSignature, publicKey)
Expand Down Expand Up @@ -6263,3 +6334,9 @@ Decode the given url-safe base64-encoded slice into its raw bytes.
| --- | --- |
| data | <code>Uint8Array</code> |
<a name="start"></a>
## start()
Initializes the console error panic hook for better error messages
**Kind**: global function
Loading

0 comments on commit bdf6b54

Please sign in to comment.