From fe7ce657bcf92566986ed1572f90e1cbb4683464 Mon Sep 17 00:00:00 2001 From: fyears <1142836+fyears@users.noreply.github.com> Date: Sat, 23 Mar 2024 23:20:56 +0800 Subject: [PATCH] expose internal keys --- .github/workflows/node.js.yml | 2 +- package.json | 2 +- src/index.ts | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 7eb4df4..f94a7da 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -22,7 +22,7 @@ jobs: - name: Checkout the repo uses: actions/checkout@v3 with: - lfs: 'true' + lfs: "true" - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 # with: diff --git a/package.json b/package.json index 7efe3fe..0b4a7ec 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "name": "@fyears/rclone-crypt", - "version": "0.0.6", + "version": "0.0.7", "description": "RClone Crypt", "repository": { "type": "git", diff --git a/src/index.ts b/src/index.ts index eac63c3..be5c57b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -128,6 +128,25 @@ fileNameEnc=${this.fileNameEnc} return this; } + updateInternalKey( + dataKey: Uint8Array, + nameKey: Uint8Array, + nameTweak: Uint8Array + ) { + this.dataKey = dataKey; + this.nameKey = nameKey; + this.nameTweak = nameTweak; + return this; + } + + getInternalKey() { + return { + dataKey: this.dataKey, + nameKey: this.nameKey, + nameTweak: this.nameTweak, + }; + } + // encryptSegment encrypts a path segment // // This uses EME with AES.