asherah 1.0.26 → 1.0.27

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.
Binary file
Binary file
Binary file
package/dist/index.d.ts CHANGED
@@ -28,6 +28,7 @@ export declare type AsherahConfig = {
28
28
  sessionCache: boolean;
29
29
  debugOutput: boolean;
30
30
  };
31
+ export declare function setupJson(config: AsherahConfig): void;
31
32
  export declare function setup(config: AsherahConfig): void;
32
33
  export declare function decrypt(partitionId: string, dataRowRecord: DataRowRecord): Buffer;
33
34
  export declare function encrypt(partitionId: string, data: Buffer): DataRowRecord;
package/dist/index.js CHANGED
@@ -1,12 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.encrypt = exports.decrypt = exports.setup = void 0;
3
+ exports.encrypt = exports.decrypt = exports.setup = exports.setupJson = void 0;
4
4
  const cobhan_1 = require("cobhan");
5
5
  const libasherah = (0, cobhan_1.load_platform_library)('node_modules/asherah/binaries', 'libasherah', {
6
6
  'Encrypt': ['int32', ['pointer', 'pointer', 'pointer', 'pointer', 'pointer', 'pointer', 'pointer']],
7
7
  'Decrypt': ['int32', ['pointer', 'pointer', 'pointer', 'int64', 'pointer', 'int64', 'pointer']],
8
8
  'Setup': ['int32', ['pointer', 'pointer', 'pointer', 'pointer', 'pointer', 'pointer', 'int32', 'pointer', 'pointer', 'pointer', 'pointer', 'int32', 'int32', 'int32']],
9
+ 'SetupJson': ['int32', ['pointer']]
9
10
  });
11
+ function setupJson(config) {
12
+ const configJsonBuffer = (0, cobhan_1.string_to_cbuffer)(JSON.stringify(config));
13
+ const result = libasherah.SetupJson(configJsonBuffer);
14
+ if (result < 0) {
15
+ throw new Error('setupJson failed: ' + result);
16
+ }
17
+ }
18
+ exports.setupJson = setupJson;
10
19
  function setup(config) {
11
20
  const kmsTypeBuffer = (0, cobhan_1.string_to_cbuffer)(config.kmsType);
12
21
  const metastoreBuffer = (0, cobhan_1.string_to_cbuffer)(config.metastore);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asherah",
3
- "version": "1.0.26",
3
+ "version": "1.0.27",
4
4
  "description": "Asherah envelope encryption and key rotation library",
5
5
  "main": "dist/index.js",
6
6
  "repository": {
Binary file