@sudoplatform/sudo-common 6.2.1 → 6.4.0
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/docs/assets/search.js +1 -1
- package/docs/classes/DefaultSudoKeyManager.html +11 -11
- package/docs/classes/SudoCryptoProviderDefaults.html +1 -1
- package/docs/enums/EncryptionAlgorithm.html +1 -1
- package/docs/enums/ListOperationResultStatus.html +3 -3
- package/docs/interfaces/AsymmetricEncryptionOptions.html +1 -1
- package/docs/interfaces/ListOperationFailureResult.html +2 -2
- package/docs/interfaces/ListOperationPartialResult.html +4 -4
- package/docs/interfaces/ListOperationSuccessResult.html +3 -3
- package/docs/interfaces/SudoCryptoProvider.html +31 -31
- package/docs/interfaces/SymmetricEncryptionOptions.html +1 -1
- package/docs/modules.html +2 -2
- package/github/docs/assets/search.js +1 -1
- package/github/docs/classes/DefaultSudoKeyManager.html +11 -11
- package/github/docs/classes/SudoCryptoProviderDefaults.html +1 -1
- package/github/docs/enums/EncryptionAlgorithm.html +1 -1
- package/github/docs/enums/ListOperationResultStatus.html +3 -3
- package/github/docs/interfaces/AsymmetricEncryptionOptions.html +1 -1
- package/github/docs/interfaces/ListOperationFailureResult.html +2 -2
- package/github/docs/interfaces/ListOperationPartialResult.html +4 -4
- package/github/docs/interfaces/ListOperationSuccessResult.html +3 -3
- package/github/docs/interfaces/SudoCryptoProvider.html +31 -31
- package/github/docs/interfaces/SymmetricEncryptionOptions.html +1 -1
- package/github/docs/modules.html +2 -2
- package/github/src/sudoKeyManager/sudoCryptoProvider.ts +1 -0
- package/github/src/sudoKeyManager/sudoKeyManager.ts +12 -20
- package/github/src/types/types.ts +1 -0
- package/github/test/unit/sudoKeyManager.spec.ts +18 -18
- package/lib/sudoKeyManager/sudoCryptoProvider.d.ts +1 -0
- package/lib/sudoKeyManager/sudoCryptoProvider.js +2 -0
- package/lib/sudoKeyManager/sudoKeyManager.js +12 -4
- package/lib/types/types.d.ts +1 -0
- package/lib/types/types.js +1 -0
- package/package.json +1 -1
- package/src/sudoKeyManager/sudoCryptoProvider.ts +1 -0
- package/src/sudoKeyManager/sudoKeyManager.ts +12 -20
- package/src/types/types.ts +1 -0
- package/test/unit/sudoKeyManager.spec.ts +18 -18
|
@@ -393,8 +393,8 @@ describe('DefaultSudoKeyManager', () => {
|
|
|
393
393
|
expect(actualKeyName).toStrictEqual('VpnKey')
|
|
394
394
|
expect(actualData).toStrictEqual(decrypted)
|
|
395
395
|
expect(actualOptions).toBeDefined()
|
|
396
|
-
expect(actualOptions
|
|
397
|
-
expect(actualOptions
|
|
396
|
+
expect(actualOptions!.iv).toStrictEqual(iv)
|
|
397
|
+
expect(actualOptions!.algorithm).toBeUndefined()
|
|
398
398
|
|
|
399
399
|
verify(
|
|
400
400
|
sudoCryptoProviderMock.encryptWithSymmetricKeyName(
|
|
@@ -430,8 +430,8 @@ describe('DefaultSudoKeyManager', () => {
|
|
|
430
430
|
expect(actualKeyName).toStrictEqual('VpnKey')
|
|
431
431
|
expect(actualData).toStrictEqual(decrypted)
|
|
432
432
|
expect(actualOptions).toBeDefined()
|
|
433
|
-
expect(actualOptions
|
|
434
|
-
expect(actualOptions
|
|
433
|
+
expect(actualOptions!.iv).toStrictEqual(options.iv)
|
|
434
|
+
expect(actualOptions!.algorithm).toStrictEqual(options.algorithm)
|
|
435
435
|
|
|
436
436
|
verify(
|
|
437
437
|
sudoCryptoProviderMock.encryptWithSymmetricKeyName(
|
|
@@ -492,8 +492,8 @@ describe('DefaultSudoKeyManager', () => {
|
|
|
492
492
|
expect(actualKey).toStrictEqual(symmetricKey)
|
|
493
493
|
expect(actualData).toStrictEqual(encrypted)
|
|
494
494
|
expect(actualOptions).toBeDefined()
|
|
495
|
-
expect(actualOptions
|
|
496
|
-
expect(actualOptions
|
|
495
|
+
expect(actualOptions!.iv).toStrictEqual(iv)
|
|
496
|
+
expect(actualOptions!.algorithm).toBeUndefined()
|
|
497
497
|
|
|
498
498
|
verify(
|
|
499
499
|
sudoCryptoProviderMock.encryptWithSymmetricKey(
|
|
@@ -530,8 +530,8 @@ describe('DefaultSudoKeyManager', () => {
|
|
|
530
530
|
expect(actualKey).toStrictEqual(symmetricKey)
|
|
531
531
|
expect(actualData).toStrictEqual(encrypted)
|
|
532
532
|
expect(actualOptions).toBeDefined()
|
|
533
|
-
expect(actualOptions
|
|
534
|
-
expect(actualOptions
|
|
533
|
+
expect(actualOptions!.iv).toBeUndefined()
|
|
534
|
+
expect(actualOptions!.algorithm).toStrictEqual(options.algorithm)
|
|
535
535
|
|
|
536
536
|
verify(
|
|
537
537
|
sudoCryptoProviderMock.encryptWithSymmetricKey(
|
|
@@ -599,8 +599,8 @@ describe('DefaultSudoKeyManager', () => {
|
|
|
599
599
|
expect(actualKeyName).toStrictEqual('VpnKey')
|
|
600
600
|
expect(actualData).toStrictEqual(encrypted)
|
|
601
601
|
expect(actualOptions).toBeDefined()
|
|
602
|
-
expect(actualOptions
|
|
603
|
-
expect(actualOptions
|
|
602
|
+
expect(actualOptions!.iv).toStrictEqual(options.iv)
|
|
603
|
+
expect(actualOptions!.algorithm).toBeUndefined()
|
|
604
604
|
|
|
605
605
|
verify(
|
|
606
606
|
sudoCryptoProviderMock.decryptWithSymmetricKeyName(
|
|
@@ -638,8 +638,8 @@ describe('DefaultSudoKeyManager', () => {
|
|
|
638
638
|
expect(actualKeyName).toStrictEqual('VpnKey')
|
|
639
639
|
expect(actualData).toStrictEqual(encrypted)
|
|
640
640
|
expect(actualOptions).toBeDefined()
|
|
641
|
-
expect(actualOptions
|
|
642
|
-
expect(actualOptions
|
|
641
|
+
expect(actualOptions!.iv).toStrictEqual(options.iv)
|
|
642
|
+
expect(actualOptions!.algorithm).toStrictEqual(options.algorithm)
|
|
643
643
|
|
|
644
644
|
verify(
|
|
645
645
|
sudoCryptoProviderMock.decryptWithSymmetricKeyName(
|
|
@@ -707,8 +707,8 @@ describe('DefaultSudoKeyManager', () => {
|
|
|
707
707
|
expect(actualKey).toStrictEqual(symmetricKey)
|
|
708
708
|
expect(actualData).toStrictEqual(encrypted)
|
|
709
709
|
expect(actualOptions).toBeDefined()
|
|
710
|
-
expect(actualOptions
|
|
711
|
-
expect(actualOptions
|
|
710
|
+
expect(actualOptions!.iv).toStrictEqual(iv)
|
|
711
|
+
expect(actualOptions!.algorithm).toBeUndefined()
|
|
712
712
|
|
|
713
713
|
verify(
|
|
714
714
|
sudoCryptoProviderMock.decryptWithSymmetricKey(
|
|
@@ -746,8 +746,8 @@ describe('DefaultSudoKeyManager', () => {
|
|
|
746
746
|
expect(actualKey).toStrictEqual(symmetricKey)
|
|
747
747
|
expect(actualData).toStrictEqual(encrypted)
|
|
748
748
|
expect(actualOptions).toBeDefined()
|
|
749
|
-
expect(actualOptions
|
|
750
|
-
expect(actualOptions
|
|
749
|
+
expect(actualOptions!.iv).toStrictEqual(iv)
|
|
750
|
+
expect(actualOptions!.algorithm).toStrictEqual(options.algorithm)
|
|
751
751
|
|
|
752
752
|
verify(
|
|
753
753
|
sudoCryptoProviderMock.decryptWithSymmetricKey(
|
|
@@ -811,7 +811,7 @@ describe('DefaultSudoKeyManager', () => {
|
|
|
811
811
|
expect(actualKeyName).toStrictEqual('VpnKey')
|
|
812
812
|
expect(actualData).toStrictEqual(decrypted)
|
|
813
813
|
expect(actualOptions).toBeDefined()
|
|
814
|
-
expect(actualOptions
|
|
814
|
+
expect(actualOptions!.algorithm).toStrictEqual(options.algorithm)
|
|
815
815
|
|
|
816
816
|
verify(
|
|
817
817
|
sudoCryptoProviderMock.encryptWithPublicKey(
|
|
@@ -875,7 +875,7 @@ describe('DefaultSudoKeyManager', () => {
|
|
|
875
875
|
expect(actualKeyName).toStrictEqual('VpnKey')
|
|
876
876
|
expect(actualData).toStrictEqual(encrypted)
|
|
877
877
|
expect(actualOptions).toBeDefined()
|
|
878
|
-
expect(actualOptions
|
|
878
|
+
expect(actualOptions!.algorithm).toStrictEqual(options.algorithm)
|
|
879
879
|
|
|
880
880
|
verify(
|
|
881
881
|
sudoCryptoProviderMock.decryptWithPrivateKey(
|
|
@@ -4,6 +4,7 @@ import { PublicKey } from './publicKey';
|
|
|
4
4
|
export declare class SudoCryptoProviderDefaults {
|
|
5
5
|
static readonly aesIVSize = 16;
|
|
6
6
|
static readonly aesKeySize = 256;
|
|
7
|
+
static readonly rsaKeySize = 2048;
|
|
7
8
|
static readonly pbkdfRounds = 10000;
|
|
8
9
|
static readonly pbkdfSaltSize = 16;
|
|
9
10
|
}
|
|
@@ -19,6 +19,8 @@ _defineProperty(SudoCryptoProviderDefaults, "aesIVSize", 16);
|
|
|
19
19
|
|
|
20
20
|
_defineProperty(SudoCryptoProviderDefaults, "aesKeySize", 256);
|
|
21
21
|
|
|
22
|
+
_defineProperty(SudoCryptoProviderDefaults, "rsaKeySize", 2048);
|
|
23
|
+
|
|
22
24
|
_defineProperty(SudoCryptoProviderDefaults, "pbkdfRounds", 10000);
|
|
23
25
|
|
|
24
26
|
_defineProperty(SudoCryptoProviderDefaults, "pbkdfSaltSize", 16);
|
|
@@ -87,7 +87,9 @@ class DefaultSudoKeyManager {
|
|
|
87
87
|
|
|
88
88
|
encryptWithSymmetricKey(key, data, ivOrOptions) {
|
|
89
89
|
if (_buffer.Buffer.isArrayBuffer(ivOrOptions)) {
|
|
90
|
-
return this.sudoCryptoProvider.encryptWithSymmetricKey(key, data,
|
|
90
|
+
return this.sudoCryptoProvider.encryptWithSymmetricKey(key, data, {
|
|
91
|
+
iv: ivOrOptions
|
|
92
|
+
});
|
|
91
93
|
} else {
|
|
92
94
|
return this.sudoCryptoProvider.encryptWithSymmetricKey(key, data, ivOrOptions);
|
|
93
95
|
}
|
|
@@ -95,7 +97,9 @@ class DefaultSudoKeyManager {
|
|
|
95
97
|
|
|
96
98
|
decryptWithSymmetricKey(key, data, ivOrOptions) {
|
|
97
99
|
if (_buffer.Buffer.isArrayBuffer(ivOrOptions)) {
|
|
98
|
-
return this.sudoCryptoProvider.decryptWithSymmetricKey(key, data,
|
|
100
|
+
return this.sudoCryptoProvider.decryptWithSymmetricKey(key, data, {
|
|
101
|
+
iv: ivOrOptions
|
|
102
|
+
});
|
|
99
103
|
} else {
|
|
100
104
|
return this.sudoCryptoProvider.decryptWithSymmetricKey(key, data, ivOrOptions);
|
|
101
105
|
}
|
|
@@ -103,7 +107,9 @@ class DefaultSudoKeyManager {
|
|
|
103
107
|
|
|
104
108
|
encryptWithSymmetricKeyName(name, data, ivOrOptions) {
|
|
105
109
|
if (_buffer.Buffer.isArrayBuffer(ivOrOptions)) {
|
|
106
|
-
return this.sudoCryptoProvider.encryptWithSymmetricKeyName(name, data,
|
|
110
|
+
return this.sudoCryptoProvider.encryptWithSymmetricKeyName(name, data, {
|
|
111
|
+
iv: ivOrOptions
|
|
112
|
+
});
|
|
107
113
|
} else {
|
|
108
114
|
return this.sudoCryptoProvider.encryptWithSymmetricKeyName(name, data, ivOrOptions);
|
|
109
115
|
}
|
|
@@ -111,7 +117,9 @@ class DefaultSudoKeyManager {
|
|
|
111
117
|
|
|
112
118
|
decryptWithSymmetricKeyName(name, data, ivOrOptions) {
|
|
113
119
|
if (_buffer.Buffer.isArrayBuffer(ivOrOptions)) {
|
|
114
|
-
return this.sudoCryptoProvider.decryptWithSymmetricKeyName(name, data,
|
|
120
|
+
return this.sudoCryptoProvider.decryptWithSymmetricKeyName(name, data, {
|
|
121
|
+
iv: ivOrOptions
|
|
122
|
+
});
|
|
115
123
|
} else {
|
|
116
124
|
return this.sudoCryptoProvider.decryptWithSymmetricKeyName(name, data, ivOrOptions);
|
|
117
125
|
}
|
package/lib/types/types.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ export interface BooleanFilter {
|
|
|
39
39
|
*/
|
|
40
40
|
export declare enum EncryptionAlgorithm {
|
|
41
41
|
AesCbcPkcs7Padding = "AES/CBC/PKCS7Padding",
|
|
42
|
+
AesGcmNoPadding = "AES/GCM/NoPadding",
|
|
42
43
|
RsaOaepSha1 = "RSA/OAEPWithSHA-1"
|
|
43
44
|
}
|
|
44
45
|
export declare type Subset<T, S> = Pick<S, Extract<keyof T, keyof S>> & Partial<Record<Exclude<keyof T, keyof S>, never>>;
|
package/lib/types/types.js
CHANGED
|
@@ -31,6 +31,7 @@ exports.EncryptionAlgorithm = EncryptionAlgorithm;
|
|
|
31
31
|
|
|
32
32
|
(function (EncryptionAlgorithm) {
|
|
33
33
|
EncryptionAlgorithm["AesCbcPkcs7Padding"] = "AES/CBC/PKCS7Padding";
|
|
34
|
+
EncryptionAlgorithm["AesGcmNoPadding"] = "AES/GCM/NoPadding";
|
|
34
35
|
EncryptionAlgorithm["RsaOaepSha1"] = "RSA/OAEPWithSHA-1";
|
|
35
36
|
})(EncryptionAlgorithm || (exports.EncryptionAlgorithm = EncryptionAlgorithm = {}));
|
|
36
37
|
|
package/package.json
CHANGED
|
@@ -5,6 +5,7 @@ import { PublicKey } from './publicKey'
|
|
|
5
5
|
export class SudoCryptoProviderDefaults {
|
|
6
6
|
public static readonly aesIVSize = 16
|
|
7
7
|
public static readonly aesKeySize = 256
|
|
8
|
+
public static readonly rsaKeySize = 2048
|
|
8
9
|
public static readonly pbkdfRounds = 10000
|
|
9
10
|
public static readonly pbkdfSaltSize = 16
|
|
10
11
|
}
|
|
@@ -435,11 +435,9 @@ export class DefaultSudoKeyManager implements SudoKeyManager {
|
|
|
435
435
|
ivOrOptions?: ArrayBuffer | SymmetricEncryptionOptions,
|
|
436
436
|
): Promise<ArrayBuffer> {
|
|
437
437
|
if (BufferUtil.isArrayBuffer(ivOrOptions)) {
|
|
438
|
-
return this.sudoCryptoProvider.encryptWithSymmetricKey(
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
ivOrOptions,
|
|
442
|
-
)
|
|
438
|
+
return this.sudoCryptoProvider.encryptWithSymmetricKey(key, data, {
|
|
439
|
+
iv: ivOrOptions,
|
|
440
|
+
})
|
|
443
441
|
} else {
|
|
444
442
|
return this.sudoCryptoProvider.encryptWithSymmetricKey(
|
|
445
443
|
key,
|
|
@@ -455,11 +453,9 @@ export class DefaultSudoKeyManager implements SudoKeyManager {
|
|
|
455
453
|
ivOrOptions?: ArrayBuffer | SymmetricEncryptionOptions,
|
|
456
454
|
): Promise<ArrayBuffer> {
|
|
457
455
|
if (BufferUtil.isArrayBuffer(ivOrOptions)) {
|
|
458
|
-
return this.sudoCryptoProvider.decryptWithSymmetricKey(
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
ivOrOptions,
|
|
462
|
-
)
|
|
456
|
+
return this.sudoCryptoProvider.decryptWithSymmetricKey(key, data, {
|
|
457
|
+
iv: ivOrOptions,
|
|
458
|
+
})
|
|
463
459
|
} else {
|
|
464
460
|
return this.sudoCryptoProvider.decryptWithSymmetricKey(
|
|
465
461
|
key,
|
|
@@ -475,11 +471,9 @@ export class DefaultSudoKeyManager implements SudoKeyManager {
|
|
|
475
471
|
ivOrOptions?: ArrayBuffer | SymmetricEncryptionOptions,
|
|
476
472
|
): Promise<ArrayBuffer> {
|
|
477
473
|
if (BufferUtil.isArrayBuffer(ivOrOptions)) {
|
|
478
|
-
return this.sudoCryptoProvider.encryptWithSymmetricKeyName(
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
ivOrOptions,
|
|
482
|
-
)
|
|
474
|
+
return this.sudoCryptoProvider.encryptWithSymmetricKeyName(name, data, {
|
|
475
|
+
iv: ivOrOptions,
|
|
476
|
+
})
|
|
483
477
|
} else {
|
|
484
478
|
return this.sudoCryptoProvider.encryptWithSymmetricKeyName(
|
|
485
479
|
name,
|
|
@@ -495,11 +489,9 @@ export class DefaultSudoKeyManager implements SudoKeyManager {
|
|
|
495
489
|
ivOrOptions?: ArrayBuffer | SymmetricEncryptionOptions,
|
|
496
490
|
): Promise<ArrayBuffer> {
|
|
497
491
|
if (BufferUtil.isArrayBuffer(ivOrOptions)) {
|
|
498
|
-
return this.sudoCryptoProvider.decryptWithSymmetricKeyName(
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
ivOrOptions,
|
|
502
|
-
)
|
|
492
|
+
return this.sudoCryptoProvider.decryptWithSymmetricKeyName(name, data, {
|
|
493
|
+
iv: ivOrOptions,
|
|
494
|
+
})
|
|
503
495
|
} else {
|
|
504
496
|
return this.sudoCryptoProvider.decryptWithSymmetricKeyName(
|
|
505
497
|
name,
|
package/src/types/types.ts
CHANGED
|
@@ -393,8 +393,8 @@ describe('DefaultSudoKeyManager', () => {
|
|
|
393
393
|
expect(actualKeyName).toStrictEqual('VpnKey')
|
|
394
394
|
expect(actualData).toStrictEqual(decrypted)
|
|
395
395
|
expect(actualOptions).toBeDefined()
|
|
396
|
-
expect(actualOptions
|
|
397
|
-
expect(actualOptions
|
|
396
|
+
expect(actualOptions!.iv).toStrictEqual(iv)
|
|
397
|
+
expect(actualOptions!.algorithm).toBeUndefined()
|
|
398
398
|
|
|
399
399
|
verify(
|
|
400
400
|
sudoCryptoProviderMock.encryptWithSymmetricKeyName(
|
|
@@ -430,8 +430,8 @@ describe('DefaultSudoKeyManager', () => {
|
|
|
430
430
|
expect(actualKeyName).toStrictEqual('VpnKey')
|
|
431
431
|
expect(actualData).toStrictEqual(decrypted)
|
|
432
432
|
expect(actualOptions).toBeDefined()
|
|
433
|
-
expect(actualOptions
|
|
434
|
-
expect(actualOptions
|
|
433
|
+
expect(actualOptions!.iv).toStrictEqual(options.iv)
|
|
434
|
+
expect(actualOptions!.algorithm).toStrictEqual(options.algorithm)
|
|
435
435
|
|
|
436
436
|
verify(
|
|
437
437
|
sudoCryptoProviderMock.encryptWithSymmetricKeyName(
|
|
@@ -492,8 +492,8 @@ describe('DefaultSudoKeyManager', () => {
|
|
|
492
492
|
expect(actualKey).toStrictEqual(symmetricKey)
|
|
493
493
|
expect(actualData).toStrictEqual(encrypted)
|
|
494
494
|
expect(actualOptions).toBeDefined()
|
|
495
|
-
expect(actualOptions
|
|
496
|
-
expect(actualOptions
|
|
495
|
+
expect(actualOptions!.iv).toStrictEqual(iv)
|
|
496
|
+
expect(actualOptions!.algorithm).toBeUndefined()
|
|
497
497
|
|
|
498
498
|
verify(
|
|
499
499
|
sudoCryptoProviderMock.encryptWithSymmetricKey(
|
|
@@ -530,8 +530,8 @@ describe('DefaultSudoKeyManager', () => {
|
|
|
530
530
|
expect(actualKey).toStrictEqual(symmetricKey)
|
|
531
531
|
expect(actualData).toStrictEqual(encrypted)
|
|
532
532
|
expect(actualOptions).toBeDefined()
|
|
533
|
-
expect(actualOptions
|
|
534
|
-
expect(actualOptions
|
|
533
|
+
expect(actualOptions!.iv).toBeUndefined()
|
|
534
|
+
expect(actualOptions!.algorithm).toStrictEqual(options.algorithm)
|
|
535
535
|
|
|
536
536
|
verify(
|
|
537
537
|
sudoCryptoProviderMock.encryptWithSymmetricKey(
|
|
@@ -599,8 +599,8 @@ describe('DefaultSudoKeyManager', () => {
|
|
|
599
599
|
expect(actualKeyName).toStrictEqual('VpnKey')
|
|
600
600
|
expect(actualData).toStrictEqual(encrypted)
|
|
601
601
|
expect(actualOptions).toBeDefined()
|
|
602
|
-
expect(actualOptions
|
|
603
|
-
expect(actualOptions
|
|
602
|
+
expect(actualOptions!.iv).toStrictEqual(options.iv)
|
|
603
|
+
expect(actualOptions!.algorithm).toBeUndefined()
|
|
604
604
|
|
|
605
605
|
verify(
|
|
606
606
|
sudoCryptoProviderMock.decryptWithSymmetricKeyName(
|
|
@@ -638,8 +638,8 @@ describe('DefaultSudoKeyManager', () => {
|
|
|
638
638
|
expect(actualKeyName).toStrictEqual('VpnKey')
|
|
639
639
|
expect(actualData).toStrictEqual(encrypted)
|
|
640
640
|
expect(actualOptions).toBeDefined()
|
|
641
|
-
expect(actualOptions
|
|
642
|
-
expect(actualOptions
|
|
641
|
+
expect(actualOptions!.iv).toStrictEqual(options.iv)
|
|
642
|
+
expect(actualOptions!.algorithm).toStrictEqual(options.algorithm)
|
|
643
643
|
|
|
644
644
|
verify(
|
|
645
645
|
sudoCryptoProviderMock.decryptWithSymmetricKeyName(
|
|
@@ -707,8 +707,8 @@ describe('DefaultSudoKeyManager', () => {
|
|
|
707
707
|
expect(actualKey).toStrictEqual(symmetricKey)
|
|
708
708
|
expect(actualData).toStrictEqual(encrypted)
|
|
709
709
|
expect(actualOptions).toBeDefined()
|
|
710
|
-
expect(actualOptions
|
|
711
|
-
expect(actualOptions
|
|
710
|
+
expect(actualOptions!.iv).toStrictEqual(iv)
|
|
711
|
+
expect(actualOptions!.algorithm).toBeUndefined()
|
|
712
712
|
|
|
713
713
|
verify(
|
|
714
714
|
sudoCryptoProviderMock.decryptWithSymmetricKey(
|
|
@@ -746,8 +746,8 @@ describe('DefaultSudoKeyManager', () => {
|
|
|
746
746
|
expect(actualKey).toStrictEqual(symmetricKey)
|
|
747
747
|
expect(actualData).toStrictEqual(encrypted)
|
|
748
748
|
expect(actualOptions).toBeDefined()
|
|
749
|
-
expect(actualOptions
|
|
750
|
-
expect(actualOptions
|
|
749
|
+
expect(actualOptions!.iv).toStrictEqual(iv)
|
|
750
|
+
expect(actualOptions!.algorithm).toStrictEqual(options.algorithm)
|
|
751
751
|
|
|
752
752
|
verify(
|
|
753
753
|
sudoCryptoProviderMock.decryptWithSymmetricKey(
|
|
@@ -811,7 +811,7 @@ describe('DefaultSudoKeyManager', () => {
|
|
|
811
811
|
expect(actualKeyName).toStrictEqual('VpnKey')
|
|
812
812
|
expect(actualData).toStrictEqual(decrypted)
|
|
813
813
|
expect(actualOptions).toBeDefined()
|
|
814
|
-
expect(actualOptions
|
|
814
|
+
expect(actualOptions!.algorithm).toStrictEqual(options.algorithm)
|
|
815
815
|
|
|
816
816
|
verify(
|
|
817
817
|
sudoCryptoProviderMock.encryptWithPublicKey(
|
|
@@ -875,7 +875,7 @@ describe('DefaultSudoKeyManager', () => {
|
|
|
875
875
|
expect(actualKeyName).toStrictEqual('VpnKey')
|
|
876
876
|
expect(actualData).toStrictEqual(encrypted)
|
|
877
877
|
expect(actualOptions).toBeDefined()
|
|
878
|
-
expect(actualOptions
|
|
878
|
+
expect(actualOptions!.algorithm).toStrictEqual(options.algorithm)
|
|
879
879
|
|
|
880
880
|
verify(
|
|
881
881
|
sudoCryptoProviderMock.decryptWithPrivateKey(
|