From 0b6a746640d28d54987f64a4a510bc8308b7f73b Mon Sep 17 00:00:00 2001 From: Abdulrahim Al Methiab Date: Wed, 16 Aug 2023 09:25:33 +0200 Subject: [PATCH] fix broken links --- bindings/wasm/docs/api-reference.md | 547 ++++++++++++-------- bindings/wasm/src/storage/key_id_storage.rs | 2 +- bindings/wasm/src/storage/wasm_storage.rs | 8 +- 3 files changed, 327 insertions(+), 230 deletions(-) diff --git a/bindings/wasm/docs/api-reference.md b/bindings/wasm/docs/api-reference.md index 62e1610d1d..69c4928ebc 100644 --- a/bindings/wasm/docs/api-reference.md +++ b/bindings/wasm/docs/api-reference.md @@ -53,7 +53,7 @@ and resolution of DID documents in Alias Outputs.

Jwk
JwkGenOutput
-

The result of a key generation in JwkStorage.

+

The result of a key generation in JwkStorage.

Jws

A wrapper around a JSON Web Signature (JWS).

@@ -71,7 +71,7 @@ and resolution of DID documents in Alias Outputs.

Options to declare validation criteria when validating credentials.

JwtCredentialValidator
-

A type for decoding and validating Credentials.

+

A type for decoding and validating Credential.

JwtDomainLinkageValidator

A validator for a Domain Linkage Configuration and Credentials.

@@ -89,7 +89,7 @@ and resolution of DID documents in Alias Outputs.

Supported verification method data formats.

MethodDigest
-

Unique identifier of a [VerificationMethod].

+

Unique identifier of a VerificationMethod.

NOTE: This class does not have a JSON representation, use the methods pack and unpack instead.

@@ -102,10 +102,19 @@ use the methods pack and unpack instead.

Presentation
+
Proof
+

Represents a cryptographic proof that can be used to validate verifiable credentials and +presentations.

+

This representation does not inherently implement any standard; instead, it +can be utilized to implement standards or user-defined proofs. The presence of the +type field is necessary to accommodate different types of cryptographic proofs.

+

Note that this proof is not related to JWT and can be used in combination or as an alternative +to it.

+
Resolver

Convenience type for resolving DID documents from different DID methods.

Also provides methods for resolving DID Documents associated with -verifiable Credentials and Presentations.

+verifiable Credentials and Presentations.

Configuration

The resolver will only be able to resolve DID documents for methods it has been configured for in the constructor.

@@ -131,6 +140,10 @@ working with storage backed DID documents.

## Members
+
StateMetadataEncoding
+
+
MethodRelationship
+
StatusCheck

Controls validation behaviour when checking whether or not a credential has been revoked by its credentialStatus.

@@ -149,14 +162,12 @@ working with storage backed DID documents.

Skip all status checks.

SubjectHolderRelationship
-

Declares how credential subjects must relate to the presentation holder during validation. -See PresentationValidationOptions::subject_holder_relationship.

+

Declares how credential subjects must relate to the presentation holder.

See also the Subject-Holder Relationship section of the specification.

AlwaysSubject

The holder must always match the subject on all credentials, regardless of their nonTransferable property. -This variant is the default used if no other variant is specified when constructing a new -PresentationValidationOptions.

+This variant is the default.

SubjectOnNonTransferable

The holder must match the subject only for credentials where the nonTransferable property is true.

@@ -173,24 +184,20 @@ This variant is the default used if no other variant is specified when construct
FirstError

Return after the first error occurs.

-
MethodRelationship
-
-
StateMetadataEncoding
-
## Functions
-
start()
-

Initializes the console error panic hook for better error messages

-
encodeB64(data)string

Encode the given bytes in url-safe base64.

decodeB64(data)Uint8Array

Decode the given url-safe base64-encoded slice into its raw bytes.

+
start()
+

Initializes the console error panic hook for better error messages

+
verifyEdDSA(alg, signingInput, decodedSignature, publicKey)

Verify a JWS signature secured with the JwsAlgorithm::EdDSA algorithm. Only the EdCurve::Ed25519 variant is supported for now.

@@ -233,7 +240,7 @@ A method-agnostic Decentralized Identifier (DID). ### coreDID.setMethodName(value) -Set the method name of the `CoreDID`. +Set the method name of the [CoreDID](#CoreDID). **Kind**: instance method of [CoreDID](#CoreDID) @@ -255,7 +262,7 @@ Set the method-specific-id of the `DID`. ### coreDID.scheme() ⇒ string -Returns the `CoreDID` scheme. +Returns the [CoreDID](#CoreDID) scheme. E.g. - `"did:example:12345678" -> "did"` @@ -265,7 +272,7 @@ E.g. ### coreDID.authority() ⇒ string -Returns the `CoreDID` authority: the method name and method-id. +Returns the [CoreDID](#CoreDID) authority: the method name and method-id. E.g. - `"did:example:12345678" -> "example:12345678"` @@ -275,7 +282,7 @@ E.g. ### coreDID.method() ⇒ string -Returns the `CoreDID` method name. +Returns the [CoreDID](#CoreDID) method name. E.g. - `"did:example:12345678" -> "example"` @@ -285,7 +292,7 @@ E.g. ### coreDID.methodId() ⇒ string -Returns the `CoreDID` method-specific ID. +Returns the [CoreDID](#CoreDID) method-specific ID. E.g. - `"did:example:12345678" -> "12345678"` @@ -295,7 +302,7 @@ E.g. ### coreDID.join(segment) ⇒ [DIDUrl](#DIDUrl) -Construct a new `DIDUrl` by joining with a relative DID Url string. +Construct a new [DIDUrl](#DIDUrl) by joining with a relative DID Url string. **Kind**: instance method of [CoreDID](#CoreDID) @@ -306,19 +313,19 @@ Construct a new `DIDUrl` by joining with a relative DID Url string. ### coreDID.toUrl() ⇒ [DIDUrl](#DIDUrl) -Clones the `CoreDID` into a `DIDUrl`. +Clones the [CoreDID](#CoreDID) into a [DIDUrl](#DIDUrl). **Kind**: instance method of [CoreDID](#CoreDID) ### coreDID.intoUrl() ⇒ [DIDUrl](#DIDUrl) -Converts the `CoreDID` into a `DIDUrl`, consuming it. +Converts the [CoreDID](#CoreDID) into a [DIDUrl](#DIDUrl), consuming it. **Kind**: instance method of [CoreDID](#CoreDID) ### coreDID.toString() ⇒ string -Returns the `CoreDID` as a string. +Returns the [CoreDID](#CoreDID) as a string. **Kind**: instance method of [CoreDID](#CoreDID) @@ -340,11 +347,11 @@ Deep clones the object. ### CoreDID.parse(input) ⇒ [CoreDID](#CoreDID) -Parses a `CoreDID` from the given `input`. +Parses a [CoreDID](#CoreDID) from the given `input`. ### Errors -Throws an error if the input is not a valid `CoreDID`. +Throws an error if the input is not a valid [CoreDID](#CoreDID). **Kind**: static method of [CoreDID](#CoreDID) @@ -438,7 +445,7 @@ A method-agnostic DID Document. ### new CoreDocument(values) -Creates a new `CoreDocument` with the given properties. +Creates a new [CoreDocument](#CoreDocument) with the given properties. | Param | Type | @@ -459,8 +466,8 @@ Sets the DID of the document. ### Warning Changing the identifier can drastically alter the results of -[`Self::resolve_method`](CoreDocument::resolve_method()), -[`Self::resolve_service`](CoreDocument::resolve_service()) and the related [DID URL dereferencing](https://w3c-ccg.github.io/did-resolution/#dereferencing) algorithm. +`resolve_method`, `resolve_service` and the related +[DID URL dereferencing](https://w3c-ccg.github.io/did-resolution/#dereferencing) algorithm. **Kind**: instance method of [CoreDocument](#CoreDocument) @@ -716,7 +723,7 @@ take place. ### coreDocument.revokeCredentials(serviceQuery, indices) -If the document has a `RevocationBitmap` service identified by `serviceQuery`, +If the document has a [RevocationBitmap](#RevocationBitmap) service identified by `serviceQuery`, revoke all specified `indices`. **Kind**: instance method of [CoreDocument](#CoreDocument) @@ -729,7 +736,7 @@ revoke all specified `indices`. ### coreDocument.unrevokeCredentials(serviceQuery, indices) -If the document has a `RevocationBitmap` service identified by `serviceQuery`, +If the document has a [RevocationBitmap](#RevocationBitmap) service identified by `serviceQuery`, unrevoke all specified `indices`. **Kind**: instance method of [CoreDocument](#CoreDocument) @@ -742,7 +749,7 @@ unrevoke all specified `indices`. ### coreDocument.clone() ⇒ [CoreDocument](#CoreDocument) -Deep clones the `CoreDocument`. +Deep clones the [CoreDocument](#CoreDocument). **Kind**: instance method of [CoreDocument](#CoreDocument) @@ -887,8 +894,9 @@ Deserializes an instance from a plain JS representation. * [.termsOfUse()](#Credential+termsOfUse) ⇒ Array.<Policy> * [.evidence()](#Credential+evidence) ⇒ Array.<Evidence> * [.nonTransferable()](#Credential+nonTransferable) ⇒ boolean \| undefined - * [.proof()](#Credential+proof) ⇒ any + * [.proof()](#Credential+proof) ⇒ [Proof](#Proof) \| undefined * [.properties()](#Credential+properties) ⇒ Map.<string, any> + * [.setProof(proof)](#Credential+setProof) * [.toJSON()](#Credential+toJSON) ⇒ any * [.clone()](#Credential+clone) ⇒ [Credential](#Credential) * _static_ @@ -900,7 +908,7 @@ Deserializes an instance from a plain JS representation. ### new Credential(values) -Constructs a new `Credential`. +Constructs a new [Credential](#Credential). | Param | Type | @@ -910,94 +918,107 @@ Constructs a new `Credential`. ### credential.context() ⇒ Array.<(string\|Record.<string, any>)> -Returns a copy of the JSON-LD context(s) applicable to the `Credential`. +Returns a copy of the JSON-LD context(s) applicable to the [Credential](#Credential). **Kind**: instance method of [Credential](#Credential) ### credential.id() ⇒ string \| undefined -Returns a copy of the unique `URI` identifying the `Credential` . +Returns a copy of the unique `URI` identifying the [Credential](#Credential) . **Kind**: instance method of [Credential](#Credential) ### credential.type() ⇒ Array.<string> -Returns a copy of the URIs defining the type of the `Credential`. +Returns a copy of the URIs defining the type of the [Credential](#Credential). **Kind**: instance method of [Credential](#Credential) ### credential.credentialSubject() ⇒ Array.<Subject> -Returns a copy of the `Credential` subject(s). +Returns a copy of the [Credential](#Credential) subject(s). **Kind**: instance method of [Credential](#Credential) ### credential.issuer() ⇒ string \| Issuer -Returns a copy of the issuer of the `Credential`. +Returns a copy of the issuer of the [Credential](#Credential). **Kind**: instance method of [Credential](#Credential) ### credential.issuanceDate() ⇒ [Timestamp](#Timestamp) -Returns a copy of the timestamp of when the `Credential` becomes valid. +Returns a copy of the timestamp of when the [Credential](#Credential) becomes valid. **Kind**: instance method of [Credential](#Credential) ### credential.expirationDate() ⇒ [Timestamp](#Timestamp) \| undefined -Returns a copy of the timestamp of when the `Credential` should no longer be considered valid. +Returns a copy of the timestamp of when the [Credential](#Credential) should no longer be considered valid. **Kind**: instance method of [Credential](#Credential) ### credential.credentialStatus() ⇒ Array.<Status> -Returns a copy of the information used to determine the current status of the `Credential`. +Returns a copy of the information used to determine the current status of the [Credential](#Credential). **Kind**: instance method of [Credential](#Credential) ### credential.credentialSchema() ⇒ Array.<Schema> -Returns a copy of the information used to assist in the enforcement of a specific `Credential` structure. +Returns a copy of the information used to assist in the enforcement of a specific [Credential](#Credential) structure. **Kind**: instance method of [Credential](#Credential) ### credential.refreshService() ⇒ Array.<RefreshService> -Returns a copy of the service(s) used to refresh an expired `Credential`. +Returns a copy of the service(s) used to refresh an expired [Credential](#Credential). **Kind**: instance method of [Credential](#Credential) ### credential.termsOfUse() ⇒ Array.<Policy> -Returns a copy of the terms-of-use specified by the `Credential` issuer. +Returns a copy of the terms-of-use specified by the [Credential](#Credential) issuer. **Kind**: instance method of [Credential](#Credential) ### credential.evidence() ⇒ Array.<Evidence> -Returns a copy of the human-readable evidence used to support the claims within the `Credential`. +Returns a copy of the human-readable evidence used to support the claims within the [Credential](#Credential). **Kind**: instance method of [Credential](#Credential) ### credential.nonTransferable() ⇒ boolean \| undefined -Returns whether or not the `Credential` must only be contained within a `Presentation` -with a proof issued from the `Credential` subject. +Returns whether or not the [Credential](#Credential) must only be contained within a [Presentation](#Presentation) +with a proof issued from the [Credential](#Credential) subject. **Kind**: instance method of [Credential](#Credential) -### credential.proof() ⇒ any -Returns a copy of the proof used to verify the `Credential`. +### credential.proof() ⇒ [Proof](#Proof) \| undefined +Optional cryptographic proof, unrelated to JWT. **Kind**: instance method of [Credential](#Credential) ### credential.properties() ⇒ Map.<string, any> -Returns a copy of the miscellaneous properties on the `Credential`. +Returns a copy of the miscellaneous properties on the [Credential](#Credential). **Kind**: instance method of [Credential](#Credential) + + +### credential.setProof(proof) +Sets the `proof` property of the [Credential](#Credential). + +Note that this proof is not related to JWT. + +**Kind**: instance method of [Credential](#Credential) + +| Param | Type | +| --- | --- | +| proof | [Proof](#Proof) \| undefined | + ### credential.toJSON() ⇒ any @@ -1070,7 +1091,7 @@ A method agnostic DID Url. ### didUrl.did() ⇒ [CoreDID](#CoreDID) -Return a copy of the `CoreDID` section of the `DIDUrl`. +Return a copy of the [CoreDID](#CoreDID) section of the [DIDUrl](#DIDUrl). **Kind**: instance method of [DIDUrl](#DIDUrl) @@ -1082,13 +1103,13 @@ Return a copy of the relative DID Url as a string, including only the path, quer ### didUrl.fragment() ⇒ string \| undefined -Returns a copy of the `DIDUrl` method fragment, if any. Excludes the leading '#'. +Returns a copy of the [DIDUrl](#DIDUrl) method fragment, if any. Excludes the leading '#'. **Kind**: instance method of [DIDUrl](#DIDUrl) ### didUrl.setFragment(value) -Sets the `fragment` component of the `DIDUrl`. +Sets the `fragment` component of the [DIDUrl](#DIDUrl). **Kind**: instance method of [DIDUrl](#DIDUrl) @@ -1099,13 +1120,13 @@ Sets the `fragment` component of the `DIDUrl`. ### didUrl.path() ⇒ string \| undefined -Returns a copy of the `DIDUrl` path. +Returns a copy of the [DIDUrl](#DIDUrl) path. **Kind**: instance method of [DIDUrl](#DIDUrl) ### didUrl.setPath(value) -Sets the `path` component of the `DIDUrl`. +Sets the `path` component of the [DIDUrl](#DIDUrl). **Kind**: instance method of [DIDUrl](#DIDUrl) @@ -1116,13 +1137,13 @@ Sets the `path` component of the `DIDUrl`. ### didUrl.query() ⇒ string \| undefined -Returns a copy of the `DIDUrl` method query, if any. Excludes the leading '?'. +Returns a copy of the [DIDUrl](#DIDUrl) method query, if any. Excludes the leading '?'. **Kind**: instance method of [DIDUrl](#DIDUrl) ### didUrl.setQuery(value) -Sets the `query` component of the `DIDUrl`. +Sets the `query` component of the [DIDUrl](#DIDUrl). **Kind**: instance method of [DIDUrl](#DIDUrl) @@ -1133,7 +1154,7 @@ Sets the `query` component of the `DIDUrl`. ### didUrl.join(segment) ⇒ [DIDUrl](#DIDUrl) -Append a string representing a path, query, and/or fragment, returning a new `DIDUrl`. +Append a string representing a path, query, and/or fragment, returning a new [DIDUrl](#DIDUrl). Must begin with a valid delimiter character: '/', '?', '#'. Overwrites the existing URL segment and any following segments in order of path, query, then fragment. @@ -1152,7 +1173,7 @@ I.e. ### didUrl.toString() ⇒ string -Returns the `DIDUrl` as a string. +Returns the [DIDUrl](#DIDUrl) as a string. **Kind**: instance method of [DIDUrl](#DIDUrl) @@ -1170,7 +1191,7 @@ Deep clones the object. ### DIDUrl.parse(input) ⇒ [DIDUrl](#DIDUrl) -Parses a `DIDUrl` from the input string. +Parses a [DIDUrl](#DIDUrl) from the input string. **Kind**: static method of [DIDUrl](#DIDUrl) @@ -1273,7 +1294,8 @@ Returns a copy of the protected header parsed from the decoded JWS. Consumes the object and returns the decoded credential. ### Warning -This destroys the `DecodedCredential` object. + +This destroys the [DecodedJwtCredential](#DecodedJwtCredential) object. **Kind**: instance method of [DecodedJwtCredential](#DecodedJwtCredential) @@ -1310,7 +1332,7 @@ Returns a copy of the protected header parsed from the decoded JWS. Consumes the object and returns the decoded presentation. ### Warning -This destroys the `DecodedJwtPresentation` object. +This destroys the [DecodedJwtPresentation](#DecodedJwtPresentation) object. **Kind**: instance method of [DecodedJwtPresentation](#DecodedJwtPresentation) @@ -1344,7 +1366,7 @@ Note: **Kind**: global class * [DomainLinkageConfiguration](#DomainLinkageConfiguration) - * [new DomainLinkageConfiguration(linked_dids)](#new_DomainLinkageConfiguration_new) + * [new DomainLinkageConfiguration(linkedDids)](#new_DomainLinkageConfiguration_new) * _instance_ * [.linkedDids()](#DomainLinkageConfiguration+linkedDids) ⇒ [Array.<Jwt>](#Jwt) * [.issuers()](#DomainLinkageConfiguration+issuers) ⇒ [Array.<CoreDID>](#CoreDID) @@ -1355,13 +1377,13 @@ Note: -### new DomainLinkageConfiguration(linked_dids) -Constructs a new `DomainLinkageConfiguration`. +### new DomainLinkageConfiguration(linkedDids) +Constructs a new [DomainLinkageConfiguration](#DomainLinkageConfiguration). | Param | Type | | --- | --- | -| linked_dids | [Array.<Jwt>](#Jwt) | +| linkedDids | [Array.<Jwt>](#Jwt) | @@ -1425,7 +1447,7 @@ Serializes this to a JSON object. ### Duration.seconds(seconds) ⇒ [Duration](#Duration) -Create a new `Duration` with the given number of seconds. +Create a new [Duration](#Duration) with the given number of seconds. **Kind**: static method of [Duration](#Duration) @@ -1436,7 +1458,7 @@ Create a new `Duration` with the given number of seconds. ### Duration.minutes(minutes) ⇒ [Duration](#Duration) -Create a new `Duration` with the given number of minutes. +Create a new [Duration](#Duration) with the given number of minutes. **Kind**: static method of [Duration](#Duration) @@ -1447,7 +1469,7 @@ Create a new `Duration` with the given number of minutes. ### Duration.hours(hours) ⇒ [Duration](#Duration) -Create a new `Duration` with the given number of hours. +Create a new [Duration](#Duration) with the given number of hours. **Kind**: static method of [Duration](#Duration) @@ -1458,7 +1480,7 @@ Create a new `Duration` with the given number of hours. ### Duration.days(days) ⇒ [Duration](#Duration) -Create a new `Duration` with the given number of days. +Create a new [Duration](#Duration) with the given number of days. **Kind**: static method of [Duration](#Duration) @@ -1469,7 +1491,7 @@ Create a new `Duration` with the given number of days. ### Duration.weeks(weeks) ⇒ [Duration](#Duration) -Create a new `Duration` with the given number of weeks. +Create a new [Duration](#Duration) with the given number of weeks. **Kind**: static method of [Duration](#Duration) @@ -1523,7 +1545,7 @@ A DID conforming to the IOTA DID method specification. ### new IotaDID(bytes, network) -Constructs a new `IotaDID` from a byte representation of the tag and the given +Constructs a new [IotaDID](#IotaDID) from a byte representation of the tag and the given network name. See also [placeholder](#IotaDID.placeholder). @@ -1537,19 +1559,19 @@ See also [placeholder](#IotaDID.placeholder). ### did.network() ⇒ string -Returns the Tangle network name of the `IotaDID`. +Returns the Tangle network name of the [IotaDID](#IotaDID). **Kind**: instance method of [IotaDID](#IotaDID) ### did.tag() ⇒ string -Returns a copy of the unique tag of the `IotaDID`. +Returns a copy of the unique tag of the [IotaDID](#IotaDID). **Kind**: instance method of [IotaDID](#IotaDID) ### did.toCoreDid() ⇒ [CoreDID](#CoreDID) -Returns the DID represented as a `CoreDID`. +Returns the DID represented as a [CoreDID](#CoreDID). **Kind**: instance method of [IotaDID](#IotaDID) @@ -1595,7 +1617,7 @@ E.g. ### did.join(segment) ⇒ [DIDUrl](#DIDUrl) -Construct a new `DIDUrl` by joining with a relative DID Url string. +Construct a new [DIDUrl](#DIDUrl) by joining with a relative DID Url string. **Kind**: instance method of [IotaDID](#IotaDID) @@ -1606,7 +1628,7 @@ Construct a new `DIDUrl` by joining with a relative DID Url string. ### did.toUrl() ⇒ [DIDUrl](#DIDUrl) -Clones the `DID` into a `DIDUrl`. +Clones the `DID` into a [DIDUrl](#DIDUrl). **Kind**: instance method of [IotaDID](#IotaDID) @@ -1618,7 +1640,7 @@ Returns the hex-encoded AliasId with a '0x' prefix, from the DID tag. ### did.intoUrl() ⇒ [DIDUrl](#DIDUrl) -Converts the `DID` into a `DIDUrl`, consuming it. +Converts the `DID` into a [DIDUrl](#DIDUrl), consuming it. **Kind**: instance method of [IotaDID](#IotaDID) @@ -1654,7 +1676,7 @@ The default Tangle network (`"iota"`). ### IotaDID.fromAliasId(aliasId, network) ⇒ [IotaDID](#IotaDID) -Constructs a new `IotaDID` from a hex representation of an Alias Id and the given +Constructs a new [IotaDID](#IotaDID) from a hex representation of an Alias Id and the given network name. **Kind**: static method of [IotaDID](#IotaDID) @@ -1667,7 +1689,7 @@ network name. ### IotaDID.placeholder(network) ⇒ [IotaDID](#IotaDID) -Creates a new placeholder [`IotaDID`] with the given network name. +Creates a new placeholder [IotaDID](#IotaDID) with the given network name. E.g. `did:iota:smr:0x0000000000000000000000000000000000000000000000000000000000000000`. @@ -1680,7 +1702,7 @@ E.g. `did:iota:smr:0x00000000000000000000000000000000000000000000000000000000000 ### IotaDID.parse(input) ⇒ [IotaDID](#IotaDID) -Parses a `IotaDID` from the input string. +Parses a [IotaDID](#IotaDID) from the input string. **Kind**: static method of [IotaDID](#IotaDID) @@ -1750,14 +1772,14 @@ Deserializes an instance from a JSON object. * [.createPresentationJwt(storage, fragment, presentation, signature_options, presentation_options)](#IotaDocument+createPresentationJwt) ⇒ [Promise.<Jwt>](#Jwt) * _static_ * [.newWithId(id)](#IotaDocument.newWithId) ⇒ [IotaDocument](#IotaDocument) - * [.unpackFromOutput(did, aliasOutput, allowEmpty, tokenSupply)](#IotaDocument.unpackFromOutput) ⇒ [IotaDocument](#IotaDocument) - * [.unpackFromBlock(network, block, protocol_parameters)](#IotaDocument.unpackFromBlock) ⇒ [Array.<IotaDocument>](#IotaDocument) + * [.unpackFromOutput(did, aliasOutput, allowEmpty)](#IotaDocument.unpackFromOutput) ⇒ [IotaDocument](#IotaDocument) + * [.unpackFromBlock(network, block)](#IotaDocument.unpackFromBlock) ⇒ [Array.<IotaDocument>](#IotaDocument) * [.fromJSON(json)](#IotaDocument.fromJSON) ⇒ [IotaDocument](#IotaDocument) ### new IotaDocument(network) -Constructs an empty DID Document with a [placeholder](#IotaDID.placeholder) identifier +Constructs an empty IOTA DID Document with a [placeholder](#IotaDID.placeholder) identifier for the given `network`. @@ -2069,7 +2091,7 @@ If the value is set to `null`, the custom property will be removed. ### iotaDocument.revokeCredentials(serviceQuery, indices) -If the document has a `RevocationBitmap` service identified by `serviceQuery`, +If the document has a [RevocationBitmap](#RevocationBitmap) service identified by `serviceQuery`, revoke all specified `indices`. **Kind**: instance method of [IotaDocument](#IotaDocument) @@ -2082,7 +2104,7 @@ revoke all specified `indices`. ### iotaDocument.unrevokeCredentials(serviceQuery, indices) -If the document has a `RevocationBitmap` service identified by `serviceQuery`, +If the document has a [RevocationBitmap](#RevocationBitmap) service identified by `serviceQuery`, unrevoke all specified `indices`. **Kind**: instance method of [IotaDocument](#IotaDocument) @@ -2095,7 +2117,7 @@ unrevoke all specified `indices`. ### iotaDocument.clone() ⇒ [IotaDocument](#IotaDocument) -Returns a deep clone of the `IotaDocument`. +Returns a deep clone of the [IotaDocument](#IotaDocument). **Kind**: instance method of [IotaDocument](#IotaDocument) @@ -2121,7 +2143,7 @@ Serializes to a plain JS representation. ### iotaDocument.toCoreDocument() ⇒ [CoreDocument](#CoreDocument) -Transforms the `IotaDocument` to its `CoreDocument` representation. +Transforms the [IotaDocument](#IotaDocument) to its [CoreDocument](#CoreDocument) representation. **Kind**: instance method of [IotaDocument](#IotaDocument) @@ -2227,7 +2249,7 @@ Constructs an empty DID Document with the given identifier. -### IotaDocument.unpackFromOutput(did, aliasOutput, allowEmpty, tokenSupply) ⇒ [IotaDocument](#IotaDocument) +### IotaDocument.unpackFromOutput(did, aliasOutput, allowEmpty) ⇒ [IotaDocument](#IotaDocument) Deserializes the document from an Alias Output. If `allowEmpty` is true, this will return an empty DID document marked as `deactivated` @@ -2244,27 +2266,23 @@ encoded in the `AliasId` alone. | Param | Type | | --- | --- | | did | [IotaDID](#IotaDID) | -| aliasOutput | IAliasOutput | +| aliasOutput | AliasOutputBuilderParams | | allowEmpty | boolean | -| tokenSupply | bigint | -### IotaDocument.unpackFromBlock(network, block, protocol_parameters) ⇒ [Array.<IotaDocument>](#IotaDocument) +### IotaDocument.unpackFromBlock(network, block) ⇒ [Array.<IotaDocument>](#IotaDocument) Returns all DID documents of the Alias Outputs contained in the block's transaction payload outputs, if any. Errors if any Alias Output does not contain a valid or empty DID Document. -`protocolResponseJson` can be obtained from a `Client`. - **Kind**: static method of [IotaDocument](#IotaDocument) | Param | Type | | --- | --- | | network | string | -| block | IBlock | -| protocol_parameters | INodeInfoProtocol | +| block | Block | @@ -2365,15 +2383,15 @@ and resolution of DID documents in Alias Outputs. **Kind**: global class * [IotaIdentityClientExt](#IotaIdentityClientExt) - * [.newDidOutput(client, address, document, rentStructure)](#IotaIdentityClientExt.newDidOutput) ⇒ Promise.<IAliasOutput> - * [.updateDidOutput(client, document)](#IotaIdentityClientExt.updateDidOutput) ⇒ Promise.<IAliasOutput> - * [.deactivateDidOutput(client, did)](#IotaIdentityClientExt.deactivateDidOutput) ⇒ Promise.<IAliasOutput> + * [.newDidOutput(client, address, document, rentStructure)](#IotaIdentityClientExt.newDidOutput) ⇒ Promise.<AliasOutputBuilderParams> + * [.updateDidOutput(client, document)](#IotaIdentityClientExt.updateDidOutput) ⇒ Promise.<AliasOutputBuilderParams> + * [.deactivateDidOutput(client, did)](#IotaIdentityClientExt.deactivateDidOutput) ⇒ Promise.<AliasOutputBuilderParams> * [.resolveDid(client, did)](#IotaIdentityClientExt.resolveDid) ⇒ [Promise.<IotaDocument>](#IotaDocument) - * [.resolveDidOutput(client, did)](#IotaIdentityClientExt.resolveDidOutput) ⇒ Promise.<IAliasOutput> + * [.resolveDidOutput(client, did)](#IotaIdentityClientExt.resolveDidOutput) ⇒ Promise.<AliasOutputBuilderParams> -### IotaIdentityClientExt.newDidOutput(client, address, document, rentStructure) ⇒ Promise.<IAliasOutput> +### IotaIdentityClientExt.newDidOutput(client, address, document, rentStructure) ⇒ Promise.<AliasOutputBuilderParams> Create a DID with a new Alias Output containing the given `document`. The `address` will be set as the state controller and governor unlock conditions. @@ -2388,13 +2406,13 @@ NOTE: this does *not* publish the Alias Output. | Param | Type | | --- | --- | | client | IIotaIdentityClient | -| address | AddressTypes | +| address | Address | | document | [IotaDocument](#IotaDocument) | | rentStructure | IRent \| undefined | -### IotaIdentityClientExt.updateDidOutput(client, document) ⇒ Promise.<IAliasOutput> +### IotaIdentityClientExt.updateDidOutput(client, document) ⇒ Promise.<AliasOutputBuilderParams> Fetches the associated Alias Output and updates it with `document` in its state metadata. The storage deposit on the output is left unchanged. If the size of the document increased, the amount should be increased manually. @@ -2410,7 +2428,7 @@ NOTE: this does *not* publish the updated Alias Output. -### IotaIdentityClientExt.deactivateDidOutput(client, did) ⇒ Promise.<IAliasOutput> +### IotaIdentityClientExt.deactivateDidOutput(client, did) ⇒ Promise.<AliasOutputBuilderParams> Removes the DID document from the state metadata of its Alias Output, effectively deactivating it. The storage deposit on the output is left unchanged, and should be reallocated manually. @@ -2442,7 +2460,7 @@ of the Alias Output is empty. -### IotaIdentityClientExt.resolveDidOutput(client, did) ⇒ Promise.<IAliasOutput> +### IotaIdentityClientExt.resolveDidOutput(client, did) ⇒ Promise.<AliasOutputBuilderParams> Fetches the `IAliasOutput` associated with the given DID. **Kind**: static method of [IotaIdentityClientExt](#IotaIdentityClientExt) @@ -2568,7 +2586,7 @@ If this JWK is of kty RSA, returns those parameters. ### jwk.toPublic() ⇒ [Jwk](#Jwk) \| undefined -Returns a clone of the Jwk with _all_ private key components unset. +Returns a clone of the [Jwk](#Jwk) with _all_ private key components unset. Nothing is returned when `kty = oct` as this key type is not considered public by this library. **Kind**: instance method of [Jwk](#Jwk) @@ -2610,7 +2628,7 @@ Deserializes an instance from a JSON object. ## JwkGenOutput -The result of a key generation in `JwkStorage`. +The result of a key generation in [JwkStorage](JwkStorage). **Kind**: global class @@ -2636,13 +2654,13 @@ The result of a key generation in `JwkStorage`. ### jwkGenOutput.jwk() ⇒ [Jwk](#Jwk) -Returns the generated public JWK. +Returns the generated public [Jwk](#Jwk). **Kind**: instance method of [JwkGenOutput](#JwkGenOutput) ### jwkGenOutput.keyId() ⇒ string -Returns the key id of the generated jwk. +Returns the key id of the generated [Jwk](#Jwk). **Kind**: instance method of [JwkGenOutput](#JwkGenOutput) @@ -2682,7 +2700,7 @@ A wrapper around a JSON Web Signature (JWS). ### new Jws(jws_string) -Creates a new `Jws` from the given string. +Creates a new [Jws](#Jws) from the given string. | Param | Type | @@ -2741,7 +2759,7 @@ Returns a clone of the JWS string. ### new JwsHeader() -Create a new empty `JwsHeader`. +Create a new empty [JwsHeader](#JwsHeader). @@ -3172,6 +3190,8 @@ Deserializes an instance from a JSON object. ### new JwsVerificationOptions(options) +Creates a new [JwsVerificationOptions](#JwsVerificationOptions) from the given fields. + | Param | Type | | --- | --- | @@ -3241,7 +3261,7 @@ A wrapper around a JSON Web Token (JWK). ### new Jwt(jwt_string) -Creates a new `Jwt` from the given string. +Creates a new [Jwt](#Jwt) from the given string. | Param | Type | @@ -3290,7 +3310,6 @@ Options to declare validation criteria when validating credentials. * [.toJSON()](#JwtCredentialValidationOptions+toJSON) ⇒ any * [.clone()](#JwtCredentialValidationOptions+clone) ⇒ [JwtCredentialValidationOptions](#JwtCredentialValidationOptions) * _static_ - * [.default()](#JwtCredentialValidationOptions.default) ⇒ [JwtCredentialValidationOptions](#JwtCredentialValidationOptions) * [.fromJSON(json)](#JwtCredentialValidationOptions.fromJSON) ⇒ [JwtCredentialValidationOptions](#JwtCredentialValidationOptions) @@ -3313,12 +3332,6 @@ Serializes this to a JSON object. Deep clones the object. **Kind**: instance method of [JwtCredentialValidationOptions](#JwtCredentialValidationOptions) - - -### JwtCredentialValidationOptions.default() ⇒ [JwtCredentialValidationOptions](#JwtCredentialValidationOptions) -Creates a new `JwtCredentialValidationOptions` with defaults. - -**Kind**: static method of [JwtCredentialValidationOptions](#JwtCredentialValidationOptions) ### JwtCredentialValidationOptions.fromJSON(json) ⇒ [JwtCredentialValidationOptions](#JwtCredentialValidationOptions) @@ -3333,7 +3346,7 @@ Deserializes an instance from a JSON object. ## JwtCredentialValidator -A type for decoding and validating `Credentials`. +A type for decoding and validating [Credential](#Credential). **Kind**: global class @@ -3353,7 +3366,7 @@ A type for decoding and validating `Credentials`. ### new JwtCredentialValidator(signatureVerifier) -Creates a new `JwtCredentialValidator`. If a `signatureVerifier` is provided it will be used when +Creates a new [JwtCredentialValidator](#JwtCredentialValidator). If a `signatureVerifier` is provided it will be used when verifying decoded JWS signatures, otherwise the default which is only capable of handling the `EdDSA` algorithm will be used. @@ -3365,7 +3378,8 @@ algorithm will be used. ### jwtCredentialValidator.validate(credential_jwt, issuer, options, fail_fast) ⇒ [DecodedJwtCredential](#DecodedJwtCredential) -Decodes and validates a `Credential` issued as a JWS. A `DecodedJwtCredential` is returned upon success. +Decodes and validates a [Credential](#Credential) issued as a JWS. A [DecodedJwtCredential](#DecodedJwtCredential) is returned upon +success. The following properties are validated according to `options`: - the issuer's signature on the JWS, @@ -3401,17 +3415,17 @@ An error is returned whenever a validated condition is not satisfied. ### jwtCredentialValidator.verifySignature(credential, trustedIssuers, options) ⇒ [DecodedJwtCredential](#DecodedJwtCredential) -Decode and verify the JWS signature of a `Credential` issued as a JWT using the DID Document of a trusted +Decode and verify the JWS signature of a [Credential](#Credential) issued as a JWT using the DID Document of a trusted issuer. -A `DecodedJwtCredential` is returned upon success. +A [DecodedJwtCredential](#DecodedJwtCredential) is returned upon success. # Warning The caller must ensure that the DID Documents of the trusted issuers are up-to-date. ## Proofs - Only the JWS signature is verified. If the `Credential` contains a `proof` property this will not be verified -by this method. + Only the JWS signature is verified. If the [Credential](#Credential) contains a `proof` property this will not be +verified by this method. # Errors This method immediately returns an error if @@ -3469,7 +3483,7 @@ Validate that the relationship between the `holder` and the credential subjects ### JwtCredentialValidator.checkStatus(credential, trustedIssuers, statusCheck) Checks whether the credential status has been revoked. -Only supports `BitmapRevocation2022`. +Only supports `RevocationBitmap2022`. **Kind**: static method of [JwtCredentialValidator](#JwtCredentialValidator) @@ -3482,7 +3496,7 @@ Only supports `BitmapRevocation2022`. ### JwtCredentialValidator.extractIssuer(credential) ⇒ [CoreDID](#CoreDID) -Utility for extracting the issuer field of a `Credential` as a DID. +Utility for extracting the issuer field of a [Credential](#Credential) as a DID. ### Errors @@ -3524,7 +3538,7 @@ A validator for a Domain Linkage Configuration and Credentials. ### new JwtDomainLinkageValidator(signatureVerifier) -Creates a new `JwtDomainLinkageValidator`. If a `signatureVerifier` is provided it will be used when +Creates a new [JwtDomainLinkageValidator](#JwtDomainLinkageValidator). If a `signatureVerifier` is provided it will be used when verifying decoded JWS signatures, otherwise the default which is only capable of handling the `EdDSA` algorithm will be used. @@ -3537,15 +3551,17 @@ algorithm will be used. ### jwtDomainLinkageValidator.validateLinkage(issuer, configuration, domain, options) Validates the linkage between a domain and a DID. -[`DomainLinkageConfiguration`] is validated according to [DID Configuration Resource Verification](https://identity.foundation/.well-known/resources/did-configuration/#did-configuration-resource-verification). +[DomainLinkageConfiguration](#DomainLinkageConfiguration) is validated according to [DID Configuration Resource Verification](https://identity.foundation/.well-known/resources/did-configuration/#did-configuration-resource-verification). Linkage is valid if no error is thrown. # Note: - Only the [JSON Web Token Proof Format](https://identity.foundation/.well-known/resources/did-configuration/#json-web-token-proof-format) + is supported. - Only the Credential issued by `issuer` is verified. # Errors + - Semantic structure of `configuration` is invalid. - `configuration` includes multiple credentials issued by `issuer`. - Validation of the matched Domain Linkage Credential fails. @@ -3563,6 +3579,7 @@ Linkage is valid if no error is thrown. ### jwtDomainLinkageValidator.validateCredential(issuer, credentialJwt, domain, options) Validates a [Domain Linkage Credential](https://identity.foundation/.well-known/resources/did-configuration/#domain-linkage-credential). + Error will be thrown in case the validation fails. **Kind**: instance method of [JwtDomainLinkageValidator](#JwtDomainLinkageValidator) @@ -3585,13 +3602,12 @@ Error will be thrown in case the validation fails. * [.toJSON()](#JwtPresentationOptions+toJSON) ⇒ any * [.clone()](#JwtPresentationOptions+clone) ⇒ [JwtPresentationOptions](#JwtPresentationOptions) * _static_ - * [.default()](#JwtPresentationOptions.default) ⇒ [JwtPresentationOptions](#JwtPresentationOptions) * [.fromJSON(json)](#JwtPresentationOptions.fromJSON) ⇒ [JwtPresentationOptions](#JwtPresentationOptions) ### new JwtPresentationOptions(options) -Creates a new `JwtPresentationOptions` from the given fields. +Creates a new [JwtPresentationOptions](#JwtPresentationOptions) from the given fields. Throws an error if any of the options are invalid. @@ -3612,12 +3628,6 @@ Serializes this to a JSON object. Deep clones the object. **Kind**: instance method of [JwtPresentationOptions](#JwtPresentationOptions) - - -### JwtPresentationOptions.default() ⇒ [JwtPresentationOptions](#JwtPresentationOptions) -Creates a new `JwtPresentationOptions` with defaults. - -**Kind**: static method of [JwtPresentationOptions](#JwtPresentationOptions) ### JwtPresentationOptions.fromJSON(json) ⇒ [JwtPresentationOptions](#JwtPresentationOptions) @@ -3642,13 +3652,12 @@ Options to declare validation criteria when validating presentation. * [.toJSON()](#JwtPresentationValidationOptions+toJSON) ⇒ any * [.clone()](#JwtPresentationValidationOptions+clone) ⇒ [JwtPresentationValidationOptions](#JwtPresentationValidationOptions) * _static_ - * [.default()](#JwtPresentationValidationOptions.default) ⇒ [JwtPresentationValidationOptions](#JwtPresentationValidationOptions) * [.fromJSON(json)](#JwtPresentationValidationOptions.fromJSON) ⇒ [JwtPresentationValidationOptions](#JwtPresentationValidationOptions) ### new JwtPresentationValidationOptions(options) -Creates a new `JwtPresentationValidationOptions` from the given fields. +Creates a new [JwtPresentationValidationOptions](#JwtPresentationValidationOptions) from the given fields. Throws an error if any of the options are invalid. @@ -3669,12 +3678,6 @@ Serializes this to a JSON object. Deep clones the object. **Kind**: instance method of [JwtPresentationValidationOptions](#JwtPresentationValidationOptions) - - -### JwtPresentationValidationOptions.default() ⇒ [JwtPresentationValidationOptions](#JwtPresentationValidationOptions) -Creates a new `JwtPresentationValidationOptions` with defaults. - -**Kind**: static method of [JwtPresentationValidationOptions](#JwtPresentationValidationOptions) ### JwtPresentationValidationOptions.fromJSON(json) ⇒ [JwtPresentationValidationOptions](#JwtPresentationValidationOptions) @@ -3692,29 +3695,29 @@ Deserializes an instance from a JSON object. **Kind**: global class * [JwtPresentationValidator](#JwtPresentationValidator) - * [new JwtPresentationValidator(signature_verifier)](#new_JwtPresentationValidator_new) + * [new JwtPresentationValidator(signatureVerifier)](#new_JwtPresentationValidator_new) * _instance_ - * [.validate(presentation_jwt, holder, validation_options)](#JwtPresentationValidator+validate) ⇒ [DecodedJwtPresentation](#DecodedJwtPresentation) + * [.validate(presentationJwt, holder, validation_options)](#JwtPresentationValidator+validate) ⇒ [DecodedJwtPresentation](#DecodedJwtPresentation) * _static_ * [.checkStructure(presentation)](#JwtPresentationValidator.checkStructure) * [.extractHolder(presentation)](#JwtPresentationValidator.extractHolder) ⇒ [CoreDID](#CoreDID) -### new JwtPresentationValidator(signature_verifier) -Creates a new `JwtPresentationValidator`. If a `signature_verifier` is provided it will be used when +### new JwtPresentationValidator(signatureVerifier) +Creates a new [JwtPresentationValidator](#JwtPresentationValidator). If a `signatureVerifier` is provided it will be used when verifying decoded JWS signatures, otherwise the default which is only capable of handling the `EdDSA` algorithm will be used. | Param | Type | | --- | --- | -| signature_verifier | IJwsVerifier \| undefined | +| signatureVerifier | IJwsVerifier \| undefined | -### jwtPresentationValidator.validate(presentation_jwt, holder, validation_options) ⇒ [DecodedJwtPresentation](#DecodedJwtPresentation) -Validates a [`JwtPresentation`]. +### jwtPresentationValidator.validate(presentationJwt, holder, validation_options) ⇒ [DecodedJwtPresentation](#DecodedJwtPresentation) +Validates a [Presentation](#Presentation) encoded as a [Jwt](#Jwt). The following properties are validated according to `options`: - the JWT can be decoded into a semantically valid presentation. @@ -3726,7 +3729,7 @@ Validation is done with respect to the properties set in `options`. # Warning * This method does NOT validate the constituent credentials and therefore also not the relationship between the -credentials' subjects and the presentation holder. This can be done with `JwtCredentialValidationOptions`. +credentials' subjects and the presentation holder. This can be done with [JwtCredentialValidationOptions](#JwtCredentialValidationOptions). * The lack of an error returned from this method is in of itself not enough to conclude that the presentation can be trusted. This section contains more information on additional checks that should be carried out before and after calling this method. @@ -3743,14 +3746,14 @@ An error is returned whenever a validated condition is not satisfied or when dec | Param | Type | | --- | --- | -| presentation_jwt | [Jwt](#Jwt) | +| presentationJwt | [Jwt](#Jwt) | | holder | [CoreDocument](#CoreDocument) \| IToCoreDocument | | validation_options | [JwtPresentationValidationOptions](#JwtPresentationValidationOptions) | ### JwtPresentationValidator.checkStructure(presentation) -Validates the semantic structure of the `JwtPresentation`. +Validates the semantic structure of the [Presentation](#Presentation). **Kind**: static method of [JwtPresentationValidator](#JwtPresentationValidator) @@ -3791,7 +3794,8 @@ Attempt to extract the holder of the presentation. ### new LinkedDomainService(options) -Constructs a new `LinkedDomainService` that wraps a spec compliant [Linked Domain Service Endpoint](https://identity.foundation/.well-known/resources/did-configuration/#linked-domain-service-endpoint) +Constructs a new [LinkedDomainService](#LinkedDomainService) that wraps a spec compliant [Linked Domain Service Endpoint](https://identity.foundation/.well-known/resources/did-configuration/#linked-domain-service-endpoint). + Domain URLs must include the `https` scheme in order to pass the domain linkage validation. @@ -3820,8 +3824,10 @@ Deep clones the object. ### LinkedDomainService.fromService(service) ⇒ [LinkedDomainService](#LinkedDomainService) -Creates a new @link{LinkedDomainService} from a @link{Service}. +Creates a new [LinkedDomainService](#LinkedDomainService) from a [Service](#Service). + # Error + Errors if `service` is not a valid Linked Domain Service. **Kind**: static method of [LinkedDomainService](#LinkedDomainService) @@ -3833,7 +3839,7 @@ Errors if `service` is not a valid Linked Domain Service. ### LinkedDomainService.isValid(service) ⇒ boolean -Returns `true` if a @link{Service} is a valid Linked Domain Service. +Returns `true` if a [Service](#Service) is a valid Linked Domain Service. **Kind**: static method of [LinkedDomainService](#LinkedDomainService) @@ -3863,19 +3869,19 @@ Supported verification method data formats. ### methodData.tryDecode() ⇒ Uint8Array -Returns a `Uint8Array` containing the decoded bytes of the `MethodData`. +Returns a `Uint8Array` containing the decoded bytes of the [MethodData](#MethodData). -This is generally a public key identified by a `MethodData` value. +This is generally a public key identified by a [MethodData](#MethodData) value. ### Errors -Decoding can fail if `MethodData` has invalid content or cannot be +Decoding can fail if [MethodData](#MethodData) has invalid content or cannot be represented as a vector of bytes. **Kind**: instance method of [MethodData](#MethodData) ### methodData.tryPublicKeyJwk() ⇒ [Jwk](#Jwk) -Returns the wrapped `Jwk` if the format is `PublicKeyJwk`. +Returns the wrapped [Jwk](#Jwk) if the format is `PublicKeyJwk`. **Kind**: instance method of [MethodData](#MethodData) @@ -3893,7 +3899,7 @@ Deep clones the object. ### MethodData.newBase58(data) ⇒ [MethodData](#MethodData) -Creates a new `MethodData` variant with Base58-BTC encoded content. +Creates a new [MethodData](#MethodData) variant with Base58-BTC encoded content. **Kind**: static method of [MethodData](#MethodData) @@ -3904,7 +3910,7 @@ Creates a new `MethodData` variant with Base58-BTC encoded content. ### MethodData.newMultibase(data) ⇒ [MethodData](#MethodData) -Creates a new `MethodData` variant with Multibase-encoded content. +Creates a new [MethodData](#MethodData) variant with Multibase-encoded content. **Kind**: static method of [MethodData](#MethodData) @@ -3915,7 +3921,7 @@ Creates a new `MethodData` variant with Multibase-encoded content. ### MethodData.newJwk(key) ⇒ [MethodData](#MethodData) -Creates a new `MethodData` variant consisting of the given `key`. +Creates a new [MethodData](#MethodData) variant consisting of the given `key`. ### Errors An error is thrown if the given `key` contains any private components. @@ -3940,7 +3946,7 @@ Deserializes an instance from a JSON object. ## MethodDigest -Unique identifier of a [`VerificationMethod`]. +Unique identifier of a [VerificationMethod](#VerificationMethod). NOTE: This class does not have a JSON representation, @@ -3967,7 +3973,7 @@ use the methods `pack` and `unpack` instead. ### methodDigest.pack() ⇒ Uint8Array -Packs `MethodDigest` into bytes. +Packs [MethodDigest](#MethodDigest) into bytes. **Kind**: instance method of [MethodDigest](#MethodDigest) @@ -3979,7 +3985,7 @@ Deep clones the object. ### MethodDigest.unpack(bytes) ⇒ [MethodDigest](#MethodDigest) -Unpacks bytes into [`MethodDigest`]. +Unpacks bytes into [MethodDigest](#MethodDigest). **Kind**: static method of [MethodDigest](#MethodDigest) @@ -4011,7 +4017,7 @@ Supported verification method types. ### methodScope.toString() ⇒ string -Returns the `MethodScope` as a string. +Returns the [MethodScope](#MethodScope) as a string. **Kind**: instance method of [MethodScope](#MethodScope) @@ -4082,7 +4088,7 @@ Supported verification method types. ### methodType.toString() ⇒ string -Returns the `MethodType` as a string. +Returns the [MethodType](#MethodType) as a string. **Kind**: instance method of [MethodType](#MethodType) @@ -4108,7 +4114,7 @@ Deep clones the object. ### MethodType.JsonWebKey() ⇒ [MethodType](#MethodType) -A verification method for use with JWT verification as prescribed by the `Jwk` +A verification method for use with JWT verification as prescribed by the [Jwk](#Jwk) in the `publicKeyJwk` entry. **Kind**: static method of [MethodType](#MethodType) @@ -4138,7 +4144,8 @@ Deserializes an instance from a JSON object. * [.holder()](#Presentation+holder) ⇒ string * [.refreshService()](#Presentation+refreshService) ⇒ Array.<RefreshService> * [.termsOfUse()](#Presentation+termsOfUse) ⇒ Array.<Policy> - * [.proof()](#Presentation+proof) ⇒ Map.<string, any> \| undefined + * [.proof()](#Presentation+proof) ⇒ [Proof](#Proof) \| undefined + * [.setProof(proof)](#Presentation+setProof) * [.properties()](#Presentation+properties) ⇒ Map.<string, any> * [.toJSON()](#Presentation+toJSON) ⇒ any * [.clone()](#Presentation+clone) ⇒ [Presentation](#Presentation) @@ -4201,10 +4208,23 @@ Returns a copy of the terms-of-use specified by the presentation holder **Kind**: instance method of [Presentation](#Presentation) -### presentation.proof() ⇒ Map.<string, any> \| undefined -Optional proof that can be verified by users in addition to JWS. +### presentation.proof() ⇒ [Proof](#Proof) \| undefined +Optional cryptographic proof, unrelated to JWT. **Kind**: instance method of [Presentation](#Presentation) + + +### presentation.setProof(proof) +Sets the proof property of the [Presentation](#Presentation). + +Note that this proof is not related to JWT. + +**Kind**: instance method of [Presentation](#Presentation) + +| Param | Type | +| --- | --- | +| proof | [Proof](#Proof) \| undefined | + ### presentation.properties() ⇒ Map.<string, any> @@ -4246,15 +4266,85 @@ Deserializes an instance from a JSON object. | --- | --- | | json | any | + + +## Proof +Represents a cryptographic proof that can be used to validate verifiable credentials and +presentations. + +This representation does not inherently implement any standard; instead, it +can be utilized to implement standards or user-defined proofs. The presence of the +`type` field is necessary to accommodate different types of cryptographic proofs. + +Note that this proof is not related to JWT and can be used in combination or as an alternative +to it. + +**Kind**: global class + +* [Proof](#Proof) + * [new Proof(type_, properties)](#new_Proof_new) + * _instance_ + * [.type()](#Proof+type) ⇒ string + * [.properties()](#Proof+properties) ⇒ any + * [.toJSON()](#Proof+toJSON) ⇒ any + * [.clone()](#Proof+clone) ⇒ [Proof](#Proof) + * _static_ + * [.fromJSON(json)](#Proof.fromJSON) ⇒ [Proof](#Proof) + + + +### new Proof(type_, properties) + +| Param | Type | +| --- | --- | +| type_ | string | +| properties | any | + + + +### proof.type() ⇒ string +Returns the type of proof. + +**Kind**: instance method of [Proof](#Proof) + + +### proof.properties() ⇒ any +Returns the properties of the proof. + +**Kind**: instance method of [Proof](#Proof) + + +### proof.toJSON() ⇒ any +Serializes this to a JSON object. + +**Kind**: instance method of [Proof](#Proof) + + +### proof.clone() ⇒ [Proof](#Proof) +Deep clones the object. + +**Kind**: instance method of [Proof](#Proof) + + +### Proof.fromJSON(json) ⇒ [Proof](#Proof) +Deserializes an instance from a JSON object. + +**Kind**: static method of [Proof](#Proof) + +| Param | Type | +| --- | --- | +| json | any | + ## Resolver Convenience type for resolving DID documents from different DID methods. Also provides methods for resolving DID Documents associated with -verifiable `Credentials` and `Presentations`. +verifiable [Credential](#Credential)s and [Presentation](#Presentation)s. # Configuration + The resolver will only be able to resolve DID documents for methods it has been configured for in the constructor. **Kind**: global class @@ -4267,7 +4357,7 @@ The resolver will only be able to resolve DID documents for methods it has been ### new Resolver(config) -Constructs a new `Resolver`. +Constructs a new [Resolver](#Resolver). # Errors If both a `client` is given and the `handlers` map contains the "iota" key the construction process @@ -4328,15 +4418,15 @@ A compressed bitmap for managing credential revocation. * [.revoke(index)](#RevocationBitmap+revoke) ⇒ boolean * [.unrevoke(index)](#RevocationBitmap+unrevoke) ⇒ boolean * [.len()](#RevocationBitmap+len) ⇒ number - * [.toEndpoint()](#RevocationBitmap+toEndpoint) ⇒ string \| Array.<string> \| Map.<string, Array.<string>> + * [.toService(serviceId)](#RevocationBitmap+toService) ⇒ [Service](#Service) * _static_ * [.type()](#RevocationBitmap.type) ⇒ string - * [.fromEndpoint(endpoint)](#RevocationBitmap.fromEndpoint) ⇒ [RevocationBitmap](#RevocationBitmap) + * [.fromEndpoint(service)](#RevocationBitmap.fromEndpoint) ⇒ [RevocationBitmap](#RevocationBitmap) ### new RevocationBitmap() -Creates a new `RevocationBitmap` instance. +Creates a new [RevocationBitmap](#RevocationBitmap) instance. @@ -4381,12 +4471,20 @@ Returns true if the index was present in the set. Returns the number of revoked credentials. **Kind**: instance method of [RevocationBitmap](#RevocationBitmap) - + -### revocationBitmap.toEndpoint() ⇒ string \| Array.<string> \| Map.<string, Array.<string>> -Return the bitmap as a data url embedded in a service endpoint. +### revocationBitmap.toService(serviceId) ⇒ [Service](#Service) +Return a `Service` with: +- the service's id set to `serviceId`, +- of type `RevocationBitmap2022`, +- and with the bitmap embedded in a data url in the service's endpoint. **Kind**: instance method of [RevocationBitmap](#RevocationBitmap) + +| Param | Type | +| --- | --- | +| serviceId | [DIDUrl](#DIDUrl) | + ### RevocationBitmap.type() ⇒ string @@ -4395,14 +4493,15 @@ The name of the service type. **Kind**: static method of [RevocationBitmap](#RevocationBitmap) -### RevocationBitmap.fromEndpoint(endpoint) ⇒ [RevocationBitmap](#RevocationBitmap) -Construct a `RevocationBitmap` from a data `url`. +### RevocationBitmap.fromEndpoint(service) ⇒ [RevocationBitmap](#RevocationBitmap) +Try to construct a [RevocationBitmap](#RevocationBitmap) from a service +if it is a valid Revocation Bitmap Service. **Kind**: static method of [RevocationBitmap](#RevocationBitmap) | Param | Type | | --- | --- | -| endpoint | string \| Array.<string> \| Map.<string, Array.<string>> | +| service | [Service](#Service) | @@ -4434,25 +4533,25 @@ A DID Document Service used to enable trusted interactions associated with a DID ### service.id() ⇒ [DIDUrl](#DIDUrl) -Returns a copy of the `Service` id. +Returns a copy of the [Service](#Service) id. **Kind**: instance method of [Service](#Service) ### service.type() ⇒ Array.<string> -Returns a copy of the `Service` type. +Returns a copy of the [Service](#Service) type. **Kind**: instance method of [Service](#Service) ### service.serviceEndpoint() ⇒ string \| Array.<string> \| Map.<string, Array.<string>> -Returns a copy of the `Service` endpoint. +Returns a copy of the [Service](#Service) endpoint. **Kind**: instance method of [Service](#Service) ### service.properties() ⇒ Map.<string, any> -Returns a copy of the custom properties on the `Service`. +Returns a copy of the custom properties on the [Service](#Service). **Kind**: instance method of [Service](#Service) @@ -4533,7 +4632,7 @@ Obtain the wrapped `JwkStorage`. ### timestamp.toRFC3339() ⇒ string -Returns the `Timestamp` as an RFC 3339 `String`. +Returns the [Timestamp](#Timestamp) as an RFC 3339 `String`. **Kind**: instance method of [Timestamp](#Timestamp) @@ -4571,7 +4670,7 @@ Serializes this to a JSON object. ### Timestamp.parse(input) ⇒ [Timestamp](#Timestamp) -Parses a `Timestamp` from the provided input string. +Parses a [Timestamp](#Timestamp) from the provided input string. **Kind**: static method of [Timestamp](#Timestamp) @@ -4582,7 +4681,7 @@ Parses a `Timestamp` from the provided input string. ### Timestamp.nowUTC() ⇒ [Timestamp](#Timestamp) -Creates a new `Timestamp` with the current date and time. +Creates a new [Timestamp](#Timestamp) with the current date and time. **Kind**: static method of [Timestamp](#Timestamp) @@ -4614,19 +4713,19 @@ Deserializes an instance from a JSON object. ### unknownCredential.tryIntoJwt() ⇒ [Jwt](#Jwt) \| undefined -Returns a `Jwt` if the credential is of type string, `undefined` otherwise. +Returns a [Jwt](#Jwt) if the credential is of type string, `undefined` otherwise. **Kind**: instance method of [UnknownCredential](#UnknownCredential) ### unknownCredential.tryIntoCredential() ⇒ [Credential](#Credential) \| undefined -Returns a `Credential` if the credential is of said type, `undefined` otherwise. +Returns a [Credential](#Credential) if the credential is of said type, `undefined` otherwise. **Kind**: instance method of [UnknownCredential](#UnknownCredential) ### unknownCredential.tryIntoRaw() ⇒ Record.<string, any> \| undefined -Returns the contained value as JSON, if it can be converted, `undefined` otherwise. +Returns the contained value as an Object, if it can be converted, `undefined` otherwise. **Kind**: instance method of [UnknownCredential](#UnknownCredential) @@ -4680,13 +4779,13 @@ A DID Document Verification Method. ### verificationMethod.id() ⇒ [DIDUrl](#DIDUrl) -Returns a copy of the `DIDUrl` of the `VerificationMethod`'s `id`. +Returns a copy of the [DIDUrl](#DIDUrl) of the [VerificationMethod](#VerificationMethod)'s `id`. **Kind**: instance method of [VerificationMethod](#VerificationMethod) ### verificationMethod.setId(id) -Sets the id of the `VerificationMethod`. +Sets the id of the [VerificationMethod](#VerificationMethod). **Kind**: instance method of [VerificationMethod](#VerificationMethod) @@ -4697,13 +4796,13 @@ Sets the id of the `VerificationMethod`. ### verificationMethod.controller() ⇒ [CoreDID](#CoreDID) -Returns a copy of the `controller` `DID` of the `VerificationMethod`. +Returns a copy of the `controller` `DID` of the [VerificationMethod](#VerificationMethod). **Kind**: instance method of [VerificationMethod](#VerificationMethod) ### verificationMethod.setController(did) -Sets the `controller` `DID` of the `VerificationMethod` object. +Sets the `controller` `DID` of the [VerificationMethod](#VerificationMethod) object. **Kind**: instance method of [VerificationMethod](#VerificationMethod) @@ -4714,13 +4813,13 @@ Sets the `controller` `DID` of the `VerificationMethod` object. ### verificationMethod.type() ⇒ [MethodType](#MethodType) -Returns a copy of the `VerificationMethod` type. +Returns a copy of the [VerificationMethod](#VerificationMethod) type. **Kind**: instance method of [VerificationMethod](#VerificationMethod) ### verificationMethod.setType(type_) -Sets the `VerificationMethod` type. +Sets the [VerificationMethod](#VerificationMethod) type. **Kind**: instance method of [VerificationMethod](#VerificationMethod) @@ -4731,13 +4830,13 @@ Sets the `VerificationMethod` type. ### verificationMethod.data() ⇒ [MethodData](#MethodData) -Returns a copy of the `VerificationMethod` public key data. +Returns a copy of the [VerificationMethod](#VerificationMethod) public key data. **Kind**: instance method of [VerificationMethod](#VerificationMethod) ### verificationMethod.setData(data) -Sets `VerificationMethod` public key data. +Sets [VerificationMethod](#VerificationMethod) public key data. **Kind**: instance method of [VerificationMethod](#VerificationMethod) @@ -4783,7 +4882,7 @@ Deep clones the object. ### VerificationMethod.newFromJwk(did, key, fragment) ⇒ [VerificationMethod](#VerificationMethod) -Creates a new `VerificationMethod` from the given `did` and `Jwk`. If `fragment` is not given +Creates a new [VerificationMethod](#VerificationMethod) from the given `did` and [Jwk](#Jwk). If `fragment` is not given the `kid` value of the given `key` will be used, if present, otherwise an error is returned. ### Recommendations @@ -4791,7 +4890,7 @@ The following recommendations are essentially taken from the `publicKeyJwk` desc - It is recommended that verification methods that use `Jwks` to represent their public keys use the value of `kid` as their fragment identifier. This is done automatically if `None` is passed in as the fragment. -- It is recommended that `Jwk` kid values are set to the public key fingerprint. +- It is recommended that [Jwk](#Jwk) kid values are set to the public key fingerprint. **Kind**: static method of [VerificationMethod](#VerificationMethod) @@ -4812,6 +4911,14 @@ Deserializes an instance from a JSON object. | --- | --- | | json | any | + + +## StateMetadataEncoding +**Kind**: global variable + + +## MethodRelationship +**Kind**: global variable ## StatusCheck @@ -4846,8 +4953,7 @@ Skip all status checks. ## SubjectHolderRelationship -Declares how credential subjects must relate to the presentation holder during validation. -See `PresentationValidationOptions::subject_holder_relationship`. +Declares how credential subjects must relate to the presentation holder. See also the [Subject-Holder Relationship](https://www.w3.org/TR/vc-data-model/#subject-holder-relationships) section of the specification. @@ -4856,8 +4962,7 @@ See also the [Subject-Holder Relationship](https://www.w3.org/TR/vc-data-model/# ## AlwaysSubject The holder must always match the subject on all credentials, regardless of their [`nonTransferable`](https://www.w3.org/TR/vc-data-model/#nontransferable-property) property. -This variant is the default used if no other variant is specified when constructing a new -`PresentationValidationOptions`. +This variant is the default. **Kind**: global variable @@ -4890,20 +4995,6 @@ Return all errors that occur during validation. Return after the first error occurs. **Kind**: global variable - - -## MethodRelationship -**Kind**: global variable - - -## StateMetadataEncoding -**Kind**: global variable - - -## start() -Initializes the console error panic hook for better error messages - -**Kind**: global function ## encodeB64(data) ⇒ string @@ -4926,6 +5017,12 @@ Decode the given url-safe base64-encoded slice into its raw bytes. | --- | --- | | data | Uint8Array | + + +## start() +Initializes the console error panic hook for better error messages + +**Kind**: global function ## verifyEdDSA(alg, signingInput, decodedSignature, publicKey) diff --git a/bindings/wasm/src/storage/key_id_storage.rs b/bindings/wasm/src/storage/key_id_storage.rs index 7ba5689634..2e0630b18e 100644 --- a/bindings/wasm/src/storage/key_id_storage.rs +++ b/bindings/wasm/src/storage/key_id_storage.rs @@ -65,7 +65,7 @@ const JWK_STORAGE: &'static str = r#" */ interface KeyIdStorage { /** - * Insert a key id into the {@link KeyIdStorage} under the given {@link MethodDigest}. + * Insert a key id into the `KeyIdStorage` under the given {@link MethodDigest}. * * If an entry for `key` already exists in the storage an error must be returned * immediately without altering the state of the storage. diff --git a/bindings/wasm/src/storage/wasm_storage.rs b/bindings/wasm/src/storage/wasm_storage.rs index e23bb62dac..72d2657950 100644 --- a/bindings/wasm/src/storage/wasm_storage.rs +++ b/bindings/wasm/src/storage/wasm_storage.rs @@ -11,27 +11,27 @@ use wasm_bindgen::prelude::*; pub(crate) type WasmStorageInner = Storage; -/// A type wrapping a {@link JwkStorage} and {@link KeyIdStorage} that should always be used together when +/// A type wrapping a `JwkStorage` and `KeyIdStorage` that should always be used together when /// working with storage backed DID documents. #[wasm_bindgen(js_name = Storage)] pub struct WasmStorage(pub(crate) Rc); #[wasm_bindgen(js_class = Storage)] impl WasmStorage { - /// Constructs a new {@link Storage}. + /// Constructs a new `Storage`. #[wasm_bindgen(constructor)] #[allow(non_snake_case)] pub fn new(jwkStorage: WasmJwkStorage, keyIdStorage: WasmKeyIdStorage) -> WasmStorage { WasmStorage(Rc::new(Storage::new(jwkStorage, keyIdStorage))) } - /// Obtain the wrapped {@link KeyIdStorage}. + /// Obtain the wrapped `KeyIdStorage`. #[wasm_bindgen(js_name = keyIdStorage)] pub fn key_id_storage(&self) -> WasmKeyIdStorage { JsValue::from(self.0.key_id_storage()).unchecked_into() } - /// Obtain the wrapped {@link JwkStorage}. + /// Obtain the wrapped `JwkStorage`. #[wasm_bindgen(js_name = keyStorage)] pub fn key_storage(&self) -> WasmJwkStorage { JsValue::from(self.0.key_storage()).unchecked_into()