diff --git a/bindings/wasm/docs/api-reference.md b/bindings/wasm/docs/api-reference.md
index 81983cc9f0..40686ddf64 100644
--- a/bindings/wasm/docs/api-reference.md
+++ b/bindings/wasm/docs/api-reference.md
@@ -76,8 +76,6 @@ and resolution of DID documents in Alias Outputs.
Decode the given url-safe base64-encoded slice into its raw bytes.
-
@@ -849,7 +851,7 @@ produced by the corresponding private key backed by the `storage` in accordance
| --- | --- |
| storage | [Storage](#Storage) |
| fragment | string |
-| presentation | [JwtPresentation](#JwtPresentation) |
+| presentation | [Presentation](#Presentation) |
| signature_options | [JwsSignatureOptions](#JwsSignatureOptions) |
| presentation_options | [JwtPresentationOptions](#JwtPresentationOptions) |
@@ -1285,16 +1287,16 @@ It does not imply anything about a potentially present proof property on the pre
**Kind**: global class
* [DecodedJwtPresentation](#DecodedJwtPresentation)
- * [.presentation()](#DecodedJwtPresentation+presentation) ⇒ [JwtPresentation](#JwtPresentation)
+ * [.presentation()](#DecodedJwtPresentation+presentation) ⇒ [Presentation](#Presentation)
* [.protectedHeader()](#DecodedJwtPresentation+protectedHeader) ⇒ [JwsHeader](#JwsHeader)
- * [.intoPresentation()](#DecodedJwtPresentation+intoPresentation) ⇒ [JwtPresentation](#JwtPresentation)
+ * [.intoPresentation()](#DecodedJwtPresentation+intoPresentation) ⇒ [Presentation](#Presentation)
* [.expirationDate()](#DecodedJwtPresentation+expirationDate) ⇒ [Timestamp](#Timestamp) \| undefined
* [.issuanceDate()](#DecodedJwtPresentation+issuanceDate) ⇒ [Timestamp](#Timestamp) \| undefined
* [.audience()](#DecodedJwtPresentation+audience) ⇒ string \| undefined
-### decodedJwtPresentation.presentation() ⇒ [JwtPresentation](#JwtPresentation)
+### decodedJwtPresentation.presentation() ⇒ [Presentation](#Presentation)
**Kind**: instance method of [DecodedJwtPresentation](#DecodedJwtPresentation)
@@ -1304,7 +1306,7 @@ Returns a copy of the protected header parsed from the decoded JWS.
**Kind**: instance method of [DecodedJwtPresentation](#DecodedJwtPresentation)
-### decodedJwtPresentation.intoPresentation() ⇒ [JwtPresentation](#JwtPresentation)
+### decodedJwtPresentation.intoPresentation() ⇒ [Presentation](#Presentation)
Consumes the object and returns the decoded presentation.
### Warning
@@ -2273,7 +2275,7 @@ produced by the corresponding private key backed by the `storage` in accordance
| --- | --- |
| storage | [Storage](#Storage) |
| fragment | string |
-| presentation | [JwtPresentation](#JwtPresentation) |
+| presentation | [Presentation](#Presentation) |
| signature_options | [JwsSignatureOptions](#JwsSignatureOptions) |
| presentation_options | [JwtPresentationOptions](#JwtPresentationOptions) |
@@ -3362,7 +3364,7 @@ Options to declare validation criteria when validating credentials.
| Param | Type |
| --- | --- |
-| options | IJwtCredentialValidationOptions |
+| options | IJwtCredentialValidationOptions \| undefined |
@@ -3572,129 +3574,6 @@ If the JWT decoding fails or the issuer field is not a valid DID.
| --- | --- |
| credential | [Jwt](#Jwt) |
-
-
-## JwtPresentation
-**Kind**: global class
-
-* [JwtPresentation](#JwtPresentation)
- * [new JwtPresentation(values)](#new_JwtPresentation_new)
- * _instance_
- * [.context()](#JwtPresentation+context) ⇒ Array.<(string\|Record.<string, any>)>
- * [.id()](#JwtPresentation+id) ⇒ string \| undefined
- * [.type()](#JwtPresentation+type) ⇒ Array.<string>
- * [.verifiableCredential()](#JwtPresentation+verifiableCredential) ⇒ [Array.<Jwt>](#Jwt)
- * [.holder()](#JwtPresentation+holder) ⇒ string
- * [.refreshService()](#JwtPresentation+refreshService) ⇒ Array.<RefreshService>
- * [.termsOfUse()](#JwtPresentation+termsOfUse) ⇒ Array.<Policy>
- * [.proof()](#JwtPresentation+proof) ⇒ Map.<string, any> \| undefined
- * [.properties()](#JwtPresentation+properties) ⇒ Map.<string, any>
- * [.toJSON()](#JwtPresentation+toJSON) ⇒ any
- * [.clone()](#JwtPresentation+clone) ⇒ [JwtPresentation](#JwtPresentation)
- * _static_
- * [.BaseContext()](#JwtPresentation.BaseContext) ⇒ string
- * [.BaseType()](#JwtPresentation.BaseType) ⇒ string
- * [.fromJSON(json)](#JwtPresentation.fromJSON) ⇒ [JwtPresentation](#JwtPresentation)
-
-
-
-### new JwtPresentation(values)
-Constructs a new presentation.
-
-
-| Param | Type |
-| --- | --- |
-| values | IJwtPresentation |
-
-
-
-### jwtPresentation.context() ⇒ Array.<(string\|Record.<string, any>)>
-Returns a copy of the JSON-LD context(s) applicable to the presentation.
-
-**Kind**: instance method of [JwtPresentation](#JwtPresentation)
-
-
-### jwtPresentation.id() ⇒ string \| undefined
-Returns a copy of the unique `URI` identifying the presentation.
-
-**Kind**: instance method of [JwtPresentation](#JwtPresentation)
-
-
-### jwtPresentation.type() ⇒ Array.<string>
-Returns a copy of the URIs defining the type of the presentation.
-
-**Kind**: instance method of [JwtPresentation](#JwtPresentation)
-
-
-### jwtPresentation.verifiableCredential() ⇒ [Array.<Jwt>](#Jwt)
-Returns the JWT credentials expressing the claims of the presentation.
-
-**Kind**: instance method of [JwtPresentation](#JwtPresentation)
-
-
-### jwtPresentation.holder() ⇒ string
-Returns a copy of the URI of the entity that generated the presentation.
-
-**Kind**: instance method of [JwtPresentation](#JwtPresentation)
-
-
-### jwtPresentation.refreshService() ⇒ Array.<RefreshService>
-Returns a copy of the service(s) used to refresh an expired [Credential](#Credential) in the presentation.
-
-**Kind**: instance method of [JwtPresentation](#JwtPresentation)
-
-
-### jwtPresentation.termsOfUse() ⇒ Array.<Policy>
-Returns a copy of the terms-of-use specified by the presentation holder
-
-**Kind**: instance method of [JwtPresentation](#JwtPresentation)
-
-
-### jwtPresentation.proof() ⇒ Map.<string, any> \| undefined
-Optional proof that can be verified by users in addition to JWS.
-
-**Kind**: instance method of [JwtPresentation](#JwtPresentation)
-
-
-### jwtPresentation.properties() ⇒ Map.<string, any>
-Returns a copy of the miscellaneous properties on the presentation.
-
-**Kind**: instance method of [JwtPresentation](#JwtPresentation)
-
-
-### jwtPresentation.toJSON() ⇒ any
-Serializes this to a JSON object.
-
-**Kind**: instance method of [JwtPresentation](#JwtPresentation)
-
-
-### jwtPresentation.clone() ⇒ [JwtPresentation](#JwtPresentation)
-Deep clones the object.
-
-**Kind**: instance method of [JwtPresentation](#JwtPresentation)
-
-
-### JwtPresentation.BaseContext() ⇒ string
-Returns the base JSON-LD context.
-
-**Kind**: static method of [JwtPresentation](#JwtPresentation)
-
-
-### JwtPresentation.BaseType() ⇒ string
-Returns the base type.
-
-**Kind**: static method of [JwtPresentation](#JwtPresentation)
-
-
-### JwtPresentation.fromJSON(json) ⇒ [JwtPresentation](#JwtPresentation)
-Deserializes an instance from a JSON object.
-
-**Kind**: static method of [JwtPresentation](#JwtPresentation)
-
-| Param | Type |
-| --- | --- |
-| json | any |
-
## JwtPresentationOptions
@@ -3776,7 +3655,7 @@ Throws an error if any of the options are invalid.
| Param | Type |
| --- | --- |
-| options | IJwtPresentationValidationOptions |
+| options | IJwtPresentationValidationOptions \| undefined |
@@ -3838,28 +3717,26 @@ algorithm will be used.
Validates a [`JwtPresentation`].
The following properties are validated according to `options`:
-- the JWT can be decoded into semantically valid presentation.
+- the JWT can be decoded into a semantically valid presentation.
- the expiration and issuance date contained in the JWT claims.
- the holder's signature.
Validation is done with respect to the properties set in `options`.
# Warning
-* This method does NOT validate the constituent credentials, nor the relationship between the
-credentials' issuers and the presentation holder.
+
+* 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`.
* 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.
## The state of the supplied DID Documents.
-The caller must ensure that the DID Documents in `holder` and `issuers` are up-to-date.
-## Properties that are not validated
- There are many properties defined in [The Verifiable Credentials Data Model](https://www.w3.org/TR/vc-data-model/) that are **not** validated, such as:
-`verifiableCredential`, credentialStatus`, `type`, `credentialSchema`, `refreshService`, **and more**.
-These should be manually checked after validation, according to your requirements.
+The caller must ensure that the DID Documents in `holder` are up-to-date.
# Errors
+
An error is returned whenever a validated condition is not satisfied or when decoding fails.
**Kind**: instance method of [JwtPresentationValidator](#JwtPresentationValidator)
@@ -3879,7 +3756,7 @@ Validates the semantic structure of the `JwtPresentation`.
| Param | Type |
| --- | --- |
-| presentation | [JwtPresentation](#JwtPresentation) |
+| presentation | [Presentation](#Presentation) |
@@ -4246,6 +4123,129 @@ Deserializes an instance from a JSON object.
| --- | --- |
| json | any |
+
+
+## Presentation
+**Kind**: global class
+
+* [Presentation](#Presentation)
+ * [new Presentation(values)](#new_Presentation_new)
+ * _instance_
+ * [.context()](#Presentation+context) ⇒ Array.<(string\|Record.<string, any>)>
+ * [.id()](#Presentation+id) ⇒ string \| undefined
+ * [.type()](#Presentation+type) ⇒ Array.<string>
+ * [.verifiableCredential()](#Presentation+verifiableCredential) ⇒ [Array.<UnknownCredential>](#UnknownCredential)
+ * [.holder()](#Presentation+holder) ⇒ string
+ * [.refreshService()](#Presentation+refreshService) ⇒ Array.<RefreshService>
+ * [.termsOfUse()](#Presentation+termsOfUse) ⇒ Array.<Policy>
+ * [.proof()](#Presentation+proof) ⇒ Map.<string, any> \| undefined
+ * [.properties()](#Presentation+properties) ⇒ Map.<string, any>
+ * [.toJSON()](#Presentation+toJSON) ⇒ any
+ * [.clone()](#Presentation+clone) ⇒ [Presentation](#Presentation)
+ * _static_
+ * [.BaseContext()](#Presentation.BaseContext) ⇒ string
+ * [.BaseType()](#Presentation.BaseType) ⇒ string
+ * [.fromJSON(json)](#Presentation.fromJSON) ⇒ [Presentation](#Presentation)
+
+
+
+### new Presentation(values)
+Constructs a new presentation.
+
+
+| Param | Type |
+| --- | --- |
+| values | IPresentation |
+
+
+
+### presentation.context() ⇒ Array.<(string\|Record.<string, any>)>
+Returns a copy of the JSON-LD context(s) applicable to the presentation.
+
+**Kind**: instance method of [Presentation](#Presentation)
+
+
+### presentation.id() ⇒ string \| undefined
+Returns a copy of the unique `URI` identifying the presentation.
+
+**Kind**: instance method of [Presentation](#Presentation)
+
+
+### presentation.type() ⇒ Array.<string>
+Returns a copy of the URIs defining the type of the presentation.
+
+**Kind**: instance method of [Presentation](#Presentation)
+
+
+### presentation.verifiableCredential() ⇒ [Array.<UnknownCredential>](#UnknownCredential)
+Returns the JWT credentials expressing the claims of the presentation.
+
+**Kind**: instance method of [Presentation](#Presentation)
+
+
+### presentation.holder() ⇒ string
+Returns a copy of the URI of the entity that generated the presentation.
+
+**Kind**: instance method of [Presentation](#Presentation)
+
+
+### presentation.refreshService() ⇒ Array.<RefreshService>
+Returns a copy of the service(s) used to refresh an expired [Credential](#Credential) in the presentation.
+
+**Kind**: instance method of [Presentation](#Presentation)
+
+
+### presentation.termsOfUse() ⇒ Array.<Policy>
+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.
+
+**Kind**: instance method of [Presentation](#Presentation)
+
+
+### presentation.properties() ⇒ Map.<string, any>
+Returns a copy of the miscellaneous properties on the presentation.
+
+**Kind**: instance method of [Presentation](#Presentation)
+
+
+### presentation.toJSON() ⇒ any
+Serializes this to a JSON object.
+
+**Kind**: instance method of [Presentation](#Presentation)
+
+
+### presentation.clone() ⇒ [Presentation](#Presentation)
+Deep clones the object.
+
+**Kind**: instance method of [Presentation](#Presentation)
+
+
+### Presentation.BaseContext() ⇒ string
+Returns the base JSON-LD context.
+
+**Kind**: static method of [Presentation](#Presentation)
+
+
+### Presentation.BaseType() ⇒ string
+Returns the base type.
+
+**Kind**: static method of [Presentation](#Presentation)
+
+
+### Presentation.fromJSON(json) ⇒ [Presentation](#Presentation)
+Deserializes an instance from a JSON object.
+
+**Kind**: static method of [Presentation](#Presentation)
+
+| Param | Type |
+| --- | --- |
+| json | any |
+
## Resolver
@@ -4596,6 +4596,62 @@ Deserializes an instance from a JSON object.
| --- | --- |
| json | any |
+
+
+## UnknownCredential
+**Kind**: global class
+
+* [UnknownCredential](#UnknownCredential)
+ * _instance_
+ * [.tryIntoJwt()](#UnknownCredential+tryIntoJwt) ⇒ [Jwt](#Jwt) \| undefined
+ * [.tryIntoCredential()](#UnknownCredential+tryIntoCredential) ⇒ [Credential](#Credential) \| undefined
+ * [.tryIntoRaw()](#UnknownCredential+tryIntoRaw) ⇒ Record.<string, any> \| undefined
+ * [.toJSON()](#UnknownCredential+toJSON) ⇒ any
+ * [.clone()](#UnknownCredential+clone) ⇒ [UnknownCredential](#UnknownCredential)
+ * _static_
+ * [.fromJSON(json)](#UnknownCredential.fromJSON) ⇒ [UnknownCredential](#UnknownCredential)
+
+
+
+### unknownCredential.tryIntoJwt() ⇒ [Jwt](#Jwt) \| undefined
+Returns a `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.
+
+**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.
+
+**Kind**: instance method of [UnknownCredential](#UnknownCredential)
+
+
+### unknownCredential.toJSON() ⇒ any
+Serializes this to a JSON object.
+
+**Kind**: instance method of [UnknownCredential](#UnknownCredential)
+
+
+### unknownCredential.clone() ⇒ [UnknownCredential](#UnknownCredential)
+Deep clones the object.
+
+**Kind**: instance method of [UnknownCredential](#UnknownCredential)
+
+
+### UnknownCredential.fromJSON(json) ⇒ [UnknownCredential](#UnknownCredential)
+Deserializes an instance from a JSON object.
+
+**Kind**: static method of [UnknownCredential](#UnknownCredential)
+
+| Param | Type |
+| --- | --- |
+| json | any |
+
## VerificationMethod
@@ -4848,28 +4904,6 @@ Return after the first error occurs.
Initializes the console error panic hook for better error messages
**Kind**: global function
-
-
-## verifyEdDSA(alg, signingInput, decodedSignature, publicKey)
-Verify a JWS signature secured with the `JwsAlgorithm::EdDSA` algorithm.
-Only the `EdCurve::Ed25519` variant is supported for now.
-
-This function is useful when one is building an `IJwsVerifier` that extends the default provided by
-the IOTA Identity Framework.
-
-# Warning
-This function does not check whether `alg = EdDSA` in the protected header. Callers are expected to assert this
-prior to calling the function.
-
-**Kind**: global function
-
-| Param | Type |
-| --- | --- |
-| alg | JwsAlgorithm |
-| signingInput | Uint8Array |
-| decodedSignature | Uint8Array |
-| publicKey | [Jwk](#Jwk) |
-
## encodeB64(data) ⇒ string
@@ -4892,3 +4926,25 @@ Decode the given url-safe base64-encoded slice into its raw bytes.
| --- | --- |
| data | Uint8Array |
+
+
+## verifyEdDSA(alg, signingInput, decodedSignature, publicKey)
+Verify a JWS signature secured with the `JwsAlgorithm::EdDSA` algorithm.
+Only the `EdCurve::Ed25519` variant is supported for now.
+
+This function is useful when one is building an `IJwsVerifier` that extends the default provided by
+the IOTA Identity Framework.
+
+# Warning
+This function does not check whether `alg = EdDSA` in the protected header. Callers are expected to assert this
+prior to calling the function.
+
+**Kind**: global function
+
+| Param | Type |
+| --- | --- |
+| alg | JwsAlgorithm |
+| signingInput | Uint8Array |
+| decodedSignature | Uint8Array |
+| publicKey | [Jwk](#Jwk) |
+
diff --git a/bindings/wasm/examples/src/0_basic/6_create_vp.ts b/bindings/wasm/examples/src/0_basic/6_create_vp.ts
index e321f040e6..deb43a8476 100644
--- a/bindings/wasm/examples/src/0_basic/6_create_vp.ts
+++ b/bindings/wasm/examples/src/0_basic/6_create_vp.ts
@@ -15,11 +15,11 @@ import {
Jwt,
JwtCredentialValidationOptions,
JwtCredentialValidator,
- JwtPresentation,
JwtPresentationOptions,
JwtPresentationValidationOptions,
JwtPresentationValidator,
KeyIdMemStore,
+ Presentation,
Resolver,
Storage,
SubjectHolderRelationship,
@@ -130,7 +130,7 @@ export async function createVP() {
// ===========================================================================
// Create a Verifiable Presentation from the Credential
- const unsignedVp = new JwtPresentation({
+ const unsignedVp = new Presentation({
holder: aliceDocument.id(),
verifiableCredential: [credentialJwt],
});
@@ -188,13 +188,16 @@ export async function createVP() {
// Validate the credentials in the presentation.
let credentialValidator = new JwtCredentialValidator();
let validationOptions = new JwtCredentialValidationOptions({
- subjectHolderRelationship: [presentationHolderDID.toString(), SubjectHolderRelationship.AlwaysSubject],
+ subjectHolderRelationship: [
+ presentationHolderDID.toString(),
+ SubjectHolderRelationship.AlwaysSubject,
+ ],
});
let jwtCredentials: Jwt[] = decodedPresentation
.presentation()
.verifiableCredential()
- .map(credential => {
+ .map((credential) => {
const jwt = credential.tryIntoJwt();
if (!jwt) {
throw new Error("expected a JWT credential");
diff --git a/bindings/wasm/examples/src/0_basic/7_revoke_vc.ts b/bindings/wasm/examples/src/0_basic/7_revoke_vc.ts
index cacb2963fb..06fdcc7701 100644
--- a/bindings/wasm/examples/src/0_basic/7_revoke_vc.ts
+++ b/bindings/wasm/examples/src/0_basic/7_revoke_vc.ts
@@ -47,7 +47,10 @@ export async function revokeVC() {
};
// Create an identity for the issuer with one verification method `key-1`.
- const issuerStorage: Storage = new Storage(new JwkMemStore(), new KeyIdMemStore());
+ const issuerStorage: Storage = new Storage(
+ new JwkMemStore(),
+ new KeyIdMemStore(),
+ );
let { document: issuerDocument, fragment: issuerFragment } = await createDid(
client,
issuerSecretManager,
@@ -55,8 +58,11 @@ export async function revokeVC() {
);
// Create an identity for the holder, in this case also the subject.
- const aliceStorage: Storage = new Storage(new JwkMemStore(), new KeyIdMemStore());
- let { document: aliceDocument, fragment: aliceFragment } = await createDid(
+ const aliceStorage: Storage = new Storage(
+ new JwkMemStore(),
+ new KeyIdMemStore(),
+ );
+ let { document: aliceDocument } = await createDid(
client,
issuerSecretManager,
aliceStorage,
@@ -74,15 +80,23 @@ export async function revokeVC() {
issuerDocument.insertService(service);
// Resolve the latest output and update it with the given document.
- let aliasOutput: IAliasOutput = await didClient.updateDidOutput(issuerDocument);
+ let aliasOutput: IAliasOutput = await didClient.updateDidOutput(
+ issuerDocument,
+ );
// Because the size of the DID document increased, we have to increase the allocated storage deposit.
// This increases the deposit amount to the new minimum.
let rentStructure: IRent = await didClient.getRentStructure();
- aliasOutput.amount = TransactionHelper.getStorageDeposit(aliasOutput, rentStructure).toString();
+ aliasOutput.amount = TransactionHelper.getStorageDeposit(
+ aliasOutput,
+ rentStructure,
+ ).toString();
// Publish the document.
- issuerDocument = await didClient.publishDidOutput(issuerSecretManager, aliasOutput);
+ issuerDocument = await didClient.publishDidOutput(
+ issuerSecretManager,
+ aliasOutput,
+ );
// Create a credential subject indicating the degree earned by Alice, linked to their DID.
const subject = {
@@ -137,8 +151,14 @@ export async function revokeVC() {
// Publish the changes.
aliasOutput = await didClient.updateDidOutput(issuerDocument);
rentStructure = await didClient.getRentStructure();
- aliasOutput.amount = TransactionHelper.getStorageDeposit(aliasOutput, rentStructure).toString();
- const update2: IotaDocument = await didClient.publishDidOutput(issuerSecretManager, aliasOutput);
+ aliasOutput.amount = TransactionHelper.getStorageDeposit(
+ aliasOutput,
+ rentStructure,
+ ).toString();
+ const update2: IotaDocument = await didClient.publishDidOutput(
+ issuerSecretManager,
+ aliasOutput,
+ );
// Credential verification now fails.
try {
@@ -159,20 +179,30 @@ export async function revokeVC() {
// By removing the verification method, that signed the credential, from the issuer's DID document,
// we effectively revoke the credential, as it will no longer be possible to validate the signature.
- let originalMethod = issuerDocument.resolveMethod(`#${issuerFragment}`) as VerificationMethod;
+ let originalMethod = issuerDocument.resolveMethod(
+ `#${issuerFragment}`,
+ ) as VerificationMethod;
await issuerDocument.purgeMethod(issuerStorage, originalMethod.id());
// Publish the changes.
aliasOutput = await didClient.updateDidOutput(issuerDocument);
rentStructure = await didClient.getRentStructure();
- aliasOutput.amount = TransactionHelper.getStorageDeposit(aliasOutput, rentStructure).toString();
- issuerDocument = await didClient.publishDidOutput(issuerSecretManager, aliasOutput);
+ aliasOutput.amount = TransactionHelper.getStorageDeposit(
+ aliasOutput,
+ rentStructure,
+ ).toString();
+ issuerDocument = await didClient.publishDidOutput(
+ issuerSecretManager,
+ aliasOutput,
+ );
// We expect the verifiable credential to be revoked.
const resolver = new Resolver({ client: didClient });
try {
// Resolve the issuer's updated DID Document to ensure the key was revoked successfully.
- const resolvedIssuerDoc = await resolver.resolve(issuerDocument.id().toString());
+ const resolvedIssuerDoc = await resolver.resolve(
+ issuerDocument.id().toString(),
+ );
jwtCredentialValidator.validate(
credentialJwt,
resolvedIssuerDoc,
diff --git a/bindings/wasm/src/credential/jwt_presentation/mod.rs b/bindings/wasm/src/credential/jwt_presentation/mod.rs
index 3f4bb3b90c..aa4af436ab 100644
--- a/bindings/wasm/src/credential/jwt_presentation/mod.rs
+++ b/bindings/wasm/src/credential/jwt_presentation/mod.rs
@@ -1,7 +1,8 @@
// Copyright 2020-2023 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0
-mod jwt_presentation;
-mod jwt_presentation_builder;
+mod presentation;
+mod presentation_builder;
-pub use self::jwt_presentation::*;
+pub use self::presentation::*;
+pub use self::presentation_builder::*;
diff --git a/bindings/wasm/src/credential/jwt_presentation/jwt_presentation.rs b/bindings/wasm/src/credential/jwt_presentation/presentation.rs
similarity index 77%
rename from bindings/wasm/src/credential/jwt_presentation/jwt_presentation.rs
rename to bindings/wasm/src/credential/jwt_presentation/presentation.rs
index 73a1b54ed2..eabda25465 100644
--- a/bindings/wasm/src/credential/jwt_presentation/jwt_presentation.rs
+++ b/bindings/wasm/src/credential/jwt_presentation/presentation.rs
@@ -3,48 +3,48 @@
use identity_iota::core::Context;
use identity_iota::core::Object;
-use identity_iota::credential::JwtPresentation;
-use identity_iota::credential::JwtPresentationBuilder;
+use identity_iota::credential::Presentation;
+use identity_iota::credential::PresentationBuilder;
use wasm_bindgen::prelude::*;
use wasm_bindgen::JsCast;
use crate::common::ArrayString;
use crate::common::MapStringAny;
-use crate::credential::jwt_presentation::jwt_presentation_builder::IJwtPresentation;
use crate::credential::ArrayContext;
use crate::credential::ArrayPolicy;
use crate::credential::ArrayRefreshService;
use crate::credential::ArrayUnknownCredential;
+use crate::credential::IPresentation;
use crate::credential::UnknownCredential;
use crate::credential::WasmUnknownCredentialContainer;
use crate::error::Result;
use crate::error::WasmResult;
-#[wasm_bindgen(js_name = JwtPresentation, inspectable)]
-pub struct WasmJwtPresentation(pub(crate) JwtPresentation);
+#[wasm_bindgen(js_name = Presentation, inspectable)]
+pub struct WasmPresentation(pub(crate) Presentation);
-#[wasm_bindgen(js_class = JwtPresentation)]
-impl WasmJwtPresentation {
+#[wasm_bindgen(js_class = Presentation)]
+impl WasmPresentation {
/// Returns the base JSON-LD context.
#[wasm_bindgen(js_name = "BaseContext")]
pub fn base_context() -> Result {
- match JwtPresentation::