@credo-ts/core 0.5.11 → 0.5.12-alpha-20240927180532

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -39,6 +39,25 @@ export interface Wallet extends Disposable {
39
39
  generateNonce(): Promise<string>;
40
40
  getRandomValues(length: number): Uint8Array;
41
41
  generateWalletKey(): Promise<string>;
42
+ /**
43
+ * Method that enables JWT encryption using ECDH-ES and AesA256Gcm and returns it as a compact JWE.
44
+ * This method is specifically added to support OpenID4VP response encryption using JARM and should later be
45
+ * refactored into a more generic method that supports encryption/decryption.
46
+ *
47
+ * @returns compact JWE
48
+ */
49
+ directEncryptCompactJweEcdhEs?(options: WalletDirectEncryptCompactJwtEcdhEsOptions): Promise<string>;
50
+ /**
51
+ * Method that enabled JWT encryption using ECDH-ES and AesA256Gcm and returns it as a compact JWE.
52
+ * This method is specifically added to support OpenID4VP response encryption using JARM and should later be
53
+ * refactored into a more generic method that supports encryption/decryption.
54
+ *
55
+ * @returns compact JWE
56
+ */
57
+ directDecryptCompactJweEcdhEs?({ compactJwe, recipientKey, }: {
58
+ compactJwe: string;
59
+ recipientKey: Key;
60
+ }): Promise<WalletDirectDecryptCompactJwtEcdhEsReturn>;
42
61
  /**
43
62
  * Get the key types supported by the wallet implementation.
44
63
  */
@@ -65,3 +84,15 @@ export interface UnpackedMessageContext {
65
84
  senderKey?: string;
66
85
  recipientKey?: string;
67
86
  }
87
+ export interface WalletDirectEncryptCompactJwtEcdhEsOptions {
88
+ recipientKey: Key;
89
+ encryptionAlgorithm: 'A256GCM';
90
+ apu?: string;
91
+ apv?: string;
92
+ data: Buffer;
93
+ header: Record<string, unknown>;
94
+ }
95
+ export interface WalletDirectDecryptCompactJwtEcdhEsReturn {
96
+ data: Buffer;
97
+ header: Record<string, unknown>;
98
+ }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@credo-ts/core",
3
3
  "main": "build/index",
4
4
  "types": "build/index",
5
- "version": "0.5.11",
5
+ "version": "0.5.12-alpha-20240927180532",
6
6
  "files": [
7
7
  "build"
8
8
  ],