Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ aries-oca-bundles/
credo-ts/
app/vendor/

# Android native build cache
app/android/app/.cxx/

# Android keystore
release.keystore
*.keystore.old
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
diff --git a/android/build.gradle b/android/build.gradle
index cde6a970a43cc930546e59a80e8716a0980bc503..f7dc11cd461beedda314f3700dc42623d82a4029 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -40,6 +40,13 @@
lintOptions {
abortOnError false
}
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_17
+ targetCompatibility JavaVersion.VERSION_17
+ }
+ kotlinOptions {
+ jvmTarget = "17"
+ }
}

dependencies {
40 changes: 0 additions & 40 deletions .yarn/patches/@credo-ts-anoncreds-npm-0.5.17-9f101d8e96.patch

This file was deleted.

24 changes: 0 additions & 24 deletions .yarn/patches/@credo-ts-core-npm-0.5.17-c528a69dd8.patch

This file was deleted.

69 changes: 69 additions & 0 deletions .yarn/patches/@credo-ts-core-npm-0.6.3-28b59086b0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
diff --git a/build/modules/vc/models/credential/W3cCredential.d.mts b/build/modules/vc/models/credential/W3cCredential.d.mts
index 6ecceb006c81a8f7dba8500b18e217c3d6b8c192..6df40bc454dec759ac878f20cb4eec9e74b742d0 100644
--- a/build/modules/vc/models/credential/W3cCredential.d.mts
+++ b/build/modules/vc/models/credential/W3cCredential.d.mts
@@ -10,7 +10,7 @@ interface W3cCredentialOptions {
id?: string;
type: Array<string>;
issuer: string | W3cIssuerOptions;
- issuanceDate: string;
+ issuanceDate?: string;
expirationDate?: string;
credentialSubject: SingleOrArray<W3cCredentialSubjectOptions>;
credentialStatus?: W3cCredentialStatus;
@@ -22,7 +22,7 @@ declare class W3cCredential {
id?: string;
type: Array<string>;
issuer: string | W3cIssuer;
- issuanceDate: string;
+ issuanceDate?: string;
expirationDate?: string;
credentialSubject: SingleOrArray<W3cCredentialSubject>;
credentialSchema?: SingleOrArray<W3cCredentialSchema>;
diff --git a/build/modules/vc/models/credential/W3cCredential.mjs b/build/modules/vc/models/credential/W3cCredential.mjs
index f3ad42c21d31e28b0f297416f17d7e560454082d..783cae8b47016777ac82d96f599319e8cfd63b3d 100644
--- a/build/modules/vc/models/credential/W3cCredential.mjs
+++ b/build/modules/vc/models/credential/W3cCredential.mjs
@@ -66,7 +66,13 @@ __decorate([
IsW3cIssuer(),
__decorateMetadata("design:type", Object)
], W3cCredential.prototype, "issuer", void 0);
-__decorate([IsRFC3339(), __decorateMetadata("design:type", String)], W3cCredential.prototype, "issuanceDate", void 0);
+// KEYRING PATCH (VCDM 2.0): issuanceDate is v1.1-only; VCDM 2.0 credentials
+// use validFrom instead, so the property must be optional to accept them.
+__decorate([
+ IsRFC3339(),
+ IsOptional(),
+ __decorateMetadata("design:type", String)
+], W3cCredential.prototype, "issuanceDate", void 0);
__decorate([
IsRFC3339(),
IsOptional(),
diff --git a/build/modules/vc/validators.mjs b/build/modules/vc/validators.mjs
index 1dc281ee34c7ee80285bf99008d2fa2bd85ef0e2..4fe87ad71253a0af11cae2f52be8f8eb8a041b8c 100644
--- a/build/modules/vc/validators.mjs
+++ b/build/modules/vc/validators.mjs
@@ -5,15 +5,21 @@ import { CREDENTIALS_CONTEXT_V1_URL, VERIFIABLE_CREDENTIAL_TYPE, VERIFIABLE_PRES
import { ValidateBy, buildMessage, isString, isURL } from "class-validator";

//#region src/modules/vc/validators.ts
+// KEYRING PATCH (VCDM 2.0 over DIDComm JSON-LD): also accept the VCDM 2.0
+// context URL as the first @context entry, so v2-context credentials can be
+// parsed/validated by the v1 W3cCredential model used by the DIDComm jsonld
+// credential format. See https://www.w3.org/TR/vc-data-model-2.0/
+const CREDENTIALS_CONTEXT_V2_URL_PATCH = "https://www.w3.org/ns/credentials/v2";
function IsCredentialJsonLdContext(validationOptions) {
const allowString = validationOptions?.allowString ?? false;
const credentialContext = validationOptions?.credentialContext ?? CREDENTIALS_CONTEXT_V1_URL;
+ const acceptedContexts = credentialContext === CREDENTIALS_CONTEXT_V1_URL ? [CREDENTIALS_CONTEXT_V1_URL, CREDENTIALS_CONTEXT_V2_URL_PATCH] : [credentialContext];
return ValidateBy({
name: "IsCredentialJsonLdContext",
validator: {
validate: (value) => {
- if (!Array.isArray(value)) return allowString && isString(value) && value === credentialContext;
- if (value[0] !== credentialContext) return false;
+ if (!Array.isArray(value)) return allowString && isString(value) && acceptedContexts.includes(value);
+ if (!acceptedContexts.includes(value[0])) return false;
return value.every((v) => isString(v) && isURL(v) || isJsonObject(v));
},
defaultMessage: buildMessage((eachPrefix) => `${eachPrefix}$property must be an array of strings or objects, where the first item is the verifiable credential context URL.`, validationOptions)
13 changes: 0 additions & 13 deletions .yarn/patches/@credo-ts-indy-vdr-npm-0.5.17-aa0b05041f.patch

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
diff --git a/build/kms/SecureEnvironmentKeyManagementService.d.mts b/build/kms/SecureEnvironmentKeyManagementService.d.mts
index a24147575a9e37473c63d112d7bb64c79dceaa54..7ff91e5712fed3d4ae4da49d6d7fe54c338e8ba9 100644
--- a/build/kms/SecureEnvironmentKeyManagementService.d.mts
+++ b/build/kms/SecureEnvironmentKeyManagementService.d.mts
@@ -1,22 +1,27 @@
import { AgentContext, Kms } from "@credo-ts/core";

//#region src/kms/SecureEnvironmentKeyManagementService.d.ts
+interface SecureEnvironmentKeyManagementServiceOptions {
+ biometricsBacked?: boolean;
+}
declare class SecureEnvironmentKeyManagementService implements Kms.KeyManagementService {
readonly backend = "secureEnvironment";
private readonly secureEnvironment;
+ private readonly options;
+ constructor(options?: SecureEnvironmentKeyManagementServiceOptions);
isOperationSupported(_agentContext: AgentContext, operation: Kms.KmsOperation): boolean;
randomBytes(_agentContext: AgentContext, _options: Kms.KmsRandomBytesOptions): Kms.KmsRandomBytesReturn;
getPublicKey(_agentContext: AgentContext, keyId: string): Promise<Kms.KmsJwkPublic | null>;
importKey(): Promise<Kms.KmsImportKeyReturn<Kms.KmsJwkPrivate>>;
deleteKey(_agentContext: AgentContext, options: Kms.KmsDeleteKeyOptions): Promise<boolean>;
encrypt(): Promise<Kms.KmsEncryptReturn>;
decrypt(): Promise<Kms.KmsDecryptReturn>;
createKey(_agentContext: AgentContext, options: Kms.KmsCreateKeyOptions): Promise<Kms.KmsCreateKeyReturn>;
sign(_agentContext: AgentContext, options: Kms.KmsSignOptions): Promise<Kms.KmsSignReturn>;
verify(): Promise<Kms.KmsVerifyReturn>;
private publicJwkFromPublicKeyBytes;
private getKeyAsserted;
}
//#endregion
-export { SecureEnvironmentKeyManagementService };
+export { SecureEnvironmentKeyManagementService, type SecureEnvironmentKeyManagementServiceOptions };
//# sourceMappingURL=SecureEnvironmentKeyManagementService.d.mts.map
diff --git a/build/kms/SecureEnvironmentKeyManagementService.mjs b/build/kms/SecureEnvironmentKeyManagementService.mjs
index 45aa862698d9d3e164c36d5b61b5977282981983..23d58743281711002c2425d39f0ab1d976d5d911 100644
--- a/build/kms/SecureEnvironmentKeyManagementService.mjs
+++ b/build/kms/SecureEnvironmentKeyManagementService.mjs
@@ -3,10 +3,11 @@ import { Kms, utils } from "@credo-ts/core";

//#region src/kms/SecureEnvironmentKeyManagementService.ts
var SecureEnvironmentKeyManagementService = class {
- constructor() {
+ constructor(options = {}) {
this.backend = "secureEnvironment";
this.secureEnvironment = importSecureEnvironment();
+ this.options = { biometricsBacked: true, ...options };
}
isOperationSupported(_agentContext, operation) {
if (operation.operation === "createKey") return operation.type.kty === "EC" && operation.type.crv === "P-256";
if (operation.operation === "sign") return operation.algorithm === "ES256";
@@ -49,7 +50,7 @@ var SecureEnvironmentKeyManagementService = class {
const keyId = options.keyId ?? utils.uuid();
const secureEnvironment = await this.secureEnvironment;
try {
- await secureEnvironment.generateKeypair(keyId);
+ await secureEnvironment.generateKeypair(keyId, this.options.biometricsBacked);
return {
keyId,
publicJwk: await this.getKeyAsserted(keyId)
@@ -64,7 +65,7 @@ var SecureEnvironmentKeyManagementService = class {
if (options.algorithm !== "ES256") throw new Kms.KeyManagementAlgorithmNotSupportedError(`algorithm '${options.algorithm}'. Only 'ES256' supported.`, this.backend);
const secureEnvironment = await this.secureEnvironment;
try {
- return { signature: await secureEnvironment.sign(options.keyId, options.data) };
+ return { signature: await secureEnvironment.sign(options.keyId, new Uint8Array(options.data), this.options.biometricsBacked) };
} catch (error) {
if (error instanceof secureEnvironment.KeyNotFoundError) throw new Kms.KeyManagementKeyNotFoundError(options.keyId, [this.backend]);
throw new Kms.KeyManagementError("Error signing with key", { cause: error });

This file was deleted.

This file was deleted.

Loading