cas-typescript-sdk 1.0.19 → 1.0.20

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.
package/index.node CHANGED
Binary file
@@ -1,6 +1,26 @@
1
1
  import { AesKeyFromX25519SharedSecret } from "../../index";
2
+ /**
3
+ * @description A wrapper class that contains methods to construct keys, nonces, and methods to encrypt and decrypt with AES-128-GCM and AES-256-GCM
4
+ *
5
+ * @example
6
+ * ```ts
7
+ * const nonce = aesWrapper.generateAESNonce();
8
+ const key = aesWrapper.aes128Key();
9
+ const textEncoder = new TextEncoder();
10
+ const array = Array.from(textEncoder.encode("Hello World"));
11
+ const encrypted = aesWrapper.aes128Encrypt(key, nonce, array);
12
+ * ```
13
+ */
2
14
  export declare class AESWrapper {
15
+ /**
16
+ * @description Generates a 128 bit AES key
17
+ * @returns returns a 128 bit AES key
18
+ */
3
19
  aes128Key(): Array<number>;
20
+ /**
21
+ * @description Generates a 256 bit AES key
22
+ * @returns returns a 256 bit AES key
23
+ */
4
24
  aes256Key(): Array<number>;
5
25
  generateAESNonce(): Array<number>;
6
26
  aes128Encrypt(aesKey: Array<number>, nonce: Array<number>, plaintext: Array<number>): Array<number>;
@@ -2,10 +2,30 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AESWrapper = void 0;
4
4
  const index_1 = require("../../index");
5
+ /**
6
+ * @description A wrapper class that contains methods to construct keys, nonces, and methods to encrypt and decrypt with AES-128-GCM and AES-256-GCM
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * const nonce = aesWrapper.generateAESNonce();
11
+ const key = aesWrapper.aes128Key();
12
+ const textEncoder = new TextEncoder();
13
+ const array = Array.from(textEncoder.encode("Hello World"));
14
+ const encrypted = aesWrapper.aes128Encrypt(key, nonce, array);
15
+ * ```
16
+ */
5
17
  class AESWrapper {
18
+ /**
19
+ * @description Generates a 128 bit AES key
20
+ * @returns returns a 128 bit AES key
21
+ */
6
22
  aes128Key() {
7
23
  return (0, index_1.aes128Key)();
8
24
  }
25
+ /**
26
+ * @description Generates a 256 bit AES key
27
+ * @returns returns a 256 bit AES key
28
+ */
9
29
  aes256Key() {
10
30
  return (0, index_1.aes256Key)();
11
31
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  {
3
3
  "name": "cas-typescript-sdk",
4
- "version": "1.0.19",
4
+ "version": "1.0.20",
5
5
  "description": "",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
@@ -11,11 +11,32 @@ import {
11
11
  aesNonce,
12
12
  } from "../../index";
13
13
 
14
+ /**
15
+ * @description A wrapper class that contains methods to construct keys, nonces, and methods to encrypt and decrypt with AES-128-GCM and AES-256-GCM
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * const nonce = aesWrapper.generateAESNonce();
20
+ const key = aesWrapper.aes128Key();
21
+ const textEncoder = new TextEncoder();
22
+ const array = Array.from(textEncoder.encode("Hello World"));
23
+ const encrypted = aesWrapper.aes128Encrypt(key, nonce, array);
24
+ * ```
25
+ */
14
26
  export class AESWrapper {
27
+
28
+ /**
29
+ * @description Generates a 128 bit AES key
30
+ * @returns returns a 128 bit AES key
31
+ */
15
32
  public aes128Key(): Array<number> {
16
33
  return aes128Key();
17
34
  }
18
35
 
36
+ /**
37
+ * @description Generates a 256 bit AES key
38
+ * @returns returns a 256 bit AES key
39
+ */
19
40
  public aes256Key(): Array<number> {
20
41
  return aes256Key();
21
42
  }