@sudoplatform/sudo-common 6.4.0 → 7.0.2
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/.gitignore +2 -1
- package/.yarn/releases/{yarn-1.22.18.cjs → yarn-1.22.19.cjs} +13 -4
- package/.yarnrc +1 -1
- package/bin/outdated-with-suppression.sh +117 -11
- package/bin/suppress-outdated.sh +36 -9
- package/dependencies-report.json +388 -4
- package/docs/assets/highlight.css +11 -11
- package/docs/assets/main.js +4 -2
- package/docs/assets/search.js +1 -1
- package/docs/assets/style.css +427 -617
- package/docs/classes/AccountLockedError.html +163 -8
- package/docs/classes/AuthenticationError.html +168 -8
- package/docs/classes/Base64.html +134 -3
- package/docs/classes/Buffer.html +158 -3
- package/docs/classes/ConfigurationNotSetError.html +163 -8
- package/docs/classes/ConfigurationSetNotFoundError.html +168 -8
- package/docs/classes/DecodeError.html +168 -8
- package/docs/classes/DefaultConfigurationManager.html +206 -18
- package/docs/classes/DefaultLogger.html +291 -25
- package/docs/classes/DefaultSudoKeyArchive.html +337 -39
- package/docs/classes/DefaultSudoKeyManager.html +813 -63
- package/docs/classes/FatalError.html +168 -8
- package/docs/classes/IllegalArgumentError.html +168 -8
- package/docs/classes/IllegalStateError.html +168 -8
- package/docs/classes/InsufficientEntitlementsError.html +163 -8
- package/docs/classes/InvalidOwnershipProofError.html +163 -8
- package/docs/classes/InvalidTokenError.html +163 -8
- package/docs/classes/KeyArchiveDecodingError.html +168 -8
- package/docs/classes/KeyArchiveIncorrectPasswordError.html +168 -8
- package/docs/classes/KeyArchiveMissingError.html +168 -8
- package/docs/classes/KeyArchiveNoPasswordRequiredError.html +168 -8
- package/docs/classes/KeyArchivePasswordRequiredError.html +168 -8
- package/docs/classes/KeyArchiveTypeError.html +168 -8
- package/docs/classes/KeyArchiveUnknownKeyTypeError.html +168 -8
- package/docs/classes/KeyArchiveVersionError.html +168 -8
- package/docs/classes/KeyNotFoundError.html +168 -8
- package/docs/classes/KeyStoreNotExportableError.html +168 -8
- package/docs/classes/LimitExceededError.html +163 -8
- package/docs/classes/NoEntitlementsError.html +163 -8
- package/docs/classes/NotAuthorizedError.html +168 -8
- package/docs/classes/NotRegisteredError.html +168 -8
- package/docs/classes/NotSignedInError.html +163 -8
- package/docs/classes/OperationNotImplementedError.html +168 -8
- package/docs/classes/RegisterError.html +168 -8
- package/docs/classes/RequestFailedError.html +188 -12
- package/docs/classes/ServiceError.html +168 -8
- package/docs/classes/SignOutError.html +168 -8
- package/docs/classes/SudoCryptoProviderDefaults.html +106 -1
- package/docs/classes/UnknownGraphQLError.html +168 -8
- package/docs/classes/UnrecognizedAlgorithmError.html +168 -8
- package/docs/classes/UserNotConfirmedError.html +163 -8
- package/docs/classes/VersionMismatchError.html +163 -8
- package/docs/enums/CachePolicy.html +71 -3
- package/docs/enums/EncryptionAlgorithm.html +78 -3
- package/docs/enums/KeyArchiveKeyType.html +86 -4
- package/docs/enums/KeyDataKeyFormat.html +84 -10
- package/docs/enums/KeyDataKeyType.html +85 -3
- package/docs/enums/ListOperationResultStatus.html +84 -9
- package/docs/enums/PublicKeyFormat.html +68 -1
- package/docs/functions/isAppSyncNetworkError.html +147 -0
- package/docs/functions/isInsecureKeyArchive.html +147 -0
- package/docs/functions/isSecureKeyArchive.html +147 -0
- package/docs/functions/isUnrecognizedKeyArchive.html +147 -0
- package/docs/functions/keyArchiveInfoFromKeyData.html +147 -0
- package/docs/functions/keyArchiveKeyTypeFromKeyDataKeyType.html +147 -0
- package/docs/functions/mapGraphQLToClientError.html +154 -0
- package/docs/functions/mapNetworkErrorToClientError.html +154 -0
- package/docs/index.html +134 -2
- package/docs/interfaces/AsymmetricEncryptionOptions.html +68 -3
- package/docs/interfaces/BooleanFilter.html +75 -3
- package/docs/interfaces/ConfigurationManager.html +191 -35
- package/docs/interfaces/KeyData.html +106 -8
- package/docs/interfaces/ListOperationFailureResult.html +76 -5
- package/docs/interfaces/ListOperationPartialResult.html +101 -9
- package/docs/interfaces/ListOperationSuccessResult.html +90 -7
- package/docs/interfaces/ListOutput.html +80 -3
- package/docs/interfaces/Logger.html +251 -45
- package/docs/interfaces/Owner.html +72 -1
- package/docs/interfaces/PublicKey.html +72 -1
- package/docs/interfaces/ServiceCompatibilityInfo.html +106 -13
- package/docs/interfaces/StringFilter.html +82 -3
- package/docs/interfaces/SudoCryptoProvider.html +860 -175
- package/docs/interfaces/SudoKeyArchive.html +245 -42
- package/docs/interfaces/SudoKeyManager.html +842 -169
- package/docs/interfaces/SymmetricEncryptionOptions.html +75 -3
- package/docs/interfaces/ValidationResult.html +79 -7
- package/docs/modules.html +248 -33
- package/docs/types/AppSyncError.html +138 -0
- package/docs/types/AppSyncNetworkError.html +138 -0
- package/docs/types/InsecureKeyArchive.html +138 -0
- package/docs/types/KeyArchive.html +138 -0
- package/docs/types/KeyArchiveKeyInfo.html +154 -0
- package/docs/types/KeyArchiveKeyInfoDecoded.html +138 -0
- package/docs/types/ListOperationResult.html +148 -0
- package/docs/types/SecureKeyArchive.html +138 -0
- package/docs/types/Subset.html +144 -0
- package/docs/types/UnrecognizedKeyArchive.html +138 -0
- package/docs/variables/CURRENT_ARCHIVE_VERSION.html +138 -0
- package/docs/variables/InsecureKeyArchiveCodec.html +138 -0
- package/docs/variables/InsecureKeyArchiveType.html +138 -0
- package/docs/variables/KeyArchiveCodec.html +138 -0
- package/docs/variables/KeyArchiveKeyInfoArrayCodec.html +138 -0
- package/docs/variables/KeyArchiveKeyInfoCodec.html +138 -0
- package/docs/variables/KeyArchiveKeyTypeCodec.html +138 -0
- package/docs/variables/SecureKeyArchiveCodec.html +138 -0
- package/docs/variables/SecureKeyArchiveType.html +138 -0
- package/docs/variables/UnrecognizedKeyArchiveCodec.html +138 -0
- package/github/.gitignore +2 -1
- package/github/.yarn/releases/{yarn-1.22.18.cjs → yarn-1.22.19.cjs} +13 -4
- package/github/.yarnrc +1 -1
- package/github/bin/outdated-with-suppression.sh +117 -11
- package/github/bin/suppress-outdated.sh +36 -9
- package/github/docs/assets/highlight.css +11 -11
- package/github/docs/assets/main.js +4 -2
- package/github/docs/assets/search.js +1 -1
- package/github/docs/assets/style.css +427 -617
- package/github/docs/classes/AccountLockedError.html +163 -8
- package/github/docs/classes/AuthenticationError.html +168 -8
- package/github/docs/classes/Base64.html +134 -3
- package/github/docs/classes/Buffer.html +158 -3
- package/github/docs/classes/ConfigurationNotSetError.html +163 -8
- package/github/docs/classes/ConfigurationSetNotFoundError.html +168 -8
- package/github/docs/classes/DecodeError.html +168 -8
- package/github/docs/classes/DefaultConfigurationManager.html +206 -18
- package/github/docs/classes/DefaultLogger.html +291 -25
- package/github/docs/classes/DefaultSudoKeyArchive.html +337 -39
- package/github/docs/classes/DefaultSudoKeyManager.html +813 -63
- package/github/docs/classes/FatalError.html +168 -8
- package/github/docs/classes/IllegalArgumentError.html +168 -8
- package/github/docs/classes/IllegalStateError.html +168 -8
- package/github/docs/classes/InsufficientEntitlementsError.html +163 -8
- package/github/docs/classes/InvalidOwnershipProofError.html +163 -8
- package/github/docs/classes/InvalidTokenError.html +163 -8
- package/github/docs/classes/KeyArchiveDecodingError.html +168 -8
- package/github/docs/classes/KeyArchiveIncorrectPasswordError.html +168 -8
- package/github/docs/classes/KeyArchiveMissingError.html +168 -8
- package/github/docs/classes/KeyArchiveNoPasswordRequiredError.html +168 -8
- package/github/docs/classes/KeyArchivePasswordRequiredError.html +168 -8
- package/github/docs/classes/KeyArchiveTypeError.html +168 -8
- package/github/docs/classes/KeyArchiveUnknownKeyTypeError.html +168 -8
- package/github/docs/classes/KeyArchiveVersionError.html +168 -8
- package/github/docs/classes/KeyNotFoundError.html +168 -8
- package/github/docs/classes/KeyStoreNotExportableError.html +168 -8
- package/github/docs/classes/LimitExceededError.html +163 -8
- package/github/docs/classes/NoEntitlementsError.html +163 -8
- package/github/docs/classes/NotAuthorizedError.html +168 -8
- package/github/docs/classes/NotRegisteredError.html +168 -8
- package/github/docs/classes/NotSignedInError.html +163 -8
- package/github/docs/classes/OperationNotImplementedError.html +168 -8
- package/github/docs/classes/RegisterError.html +168 -8
- package/github/docs/classes/RequestFailedError.html +188 -12
- package/github/docs/classes/ServiceError.html +168 -8
- package/github/docs/classes/SignOutError.html +168 -8
- package/github/docs/classes/SudoCryptoProviderDefaults.html +106 -1
- package/github/docs/classes/UnknownGraphQLError.html +168 -8
- package/github/docs/classes/UnrecognizedAlgorithmError.html +168 -8
- package/github/docs/classes/UserNotConfirmedError.html +163 -8
- package/github/docs/classes/VersionMismatchError.html +163 -8
- package/github/docs/enums/CachePolicy.html +71 -3
- package/github/docs/enums/EncryptionAlgorithm.html +78 -3
- package/github/docs/enums/KeyArchiveKeyType.html +86 -4
- package/github/docs/enums/KeyDataKeyFormat.html +84 -10
- package/github/docs/enums/KeyDataKeyType.html +85 -3
- package/github/docs/enums/ListOperationResultStatus.html +84 -9
- package/github/docs/enums/PublicKeyFormat.html +68 -1
- package/github/docs/functions/isAppSyncNetworkError.html +147 -0
- package/github/docs/functions/isInsecureKeyArchive.html +147 -0
- package/github/docs/functions/isSecureKeyArchive.html +147 -0
- package/github/docs/functions/isUnrecognizedKeyArchive.html +147 -0
- package/github/docs/functions/keyArchiveInfoFromKeyData.html +147 -0
- package/github/docs/functions/keyArchiveKeyTypeFromKeyDataKeyType.html +147 -0
- package/github/docs/functions/mapGraphQLToClientError.html +154 -0
- package/github/docs/functions/mapNetworkErrorToClientError.html +154 -0
- package/github/docs/index.html +134 -2
- package/github/docs/interfaces/AsymmetricEncryptionOptions.html +68 -3
- package/github/docs/interfaces/BooleanFilter.html +75 -3
- package/github/docs/interfaces/ConfigurationManager.html +191 -35
- package/github/docs/interfaces/KeyData.html +106 -8
- package/github/docs/interfaces/ListOperationFailureResult.html +76 -5
- package/github/docs/interfaces/ListOperationPartialResult.html +101 -9
- package/github/docs/interfaces/ListOperationSuccessResult.html +90 -7
- package/github/docs/interfaces/ListOutput.html +80 -3
- package/github/docs/interfaces/Logger.html +251 -45
- package/github/docs/interfaces/Owner.html +72 -1
- package/github/docs/interfaces/PublicKey.html +72 -1
- package/github/docs/interfaces/ServiceCompatibilityInfo.html +106 -13
- package/github/docs/interfaces/StringFilter.html +82 -3
- package/github/docs/interfaces/SudoCryptoProvider.html +860 -175
- package/github/docs/interfaces/SudoKeyArchive.html +245 -42
- package/github/docs/interfaces/SudoKeyManager.html +842 -169
- package/github/docs/interfaces/SymmetricEncryptionOptions.html +75 -3
- package/github/docs/interfaces/ValidationResult.html +79 -7
- package/github/docs/modules.html +248 -33
- package/github/docs/types/AppSyncError.html +138 -0
- package/github/docs/types/AppSyncNetworkError.html +138 -0
- package/github/docs/types/InsecureKeyArchive.html +138 -0
- package/github/docs/types/KeyArchive.html +138 -0
- package/github/docs/types/KeyArchiveKeyInfo.html +154 -0
- package/github/docs/types/KeyArchiveKeyInfoDecoded.html +138 -0
- package/github/docs/types/ListOperationResult.html +148 -0
- package/github/docs/types/SecureKeyArchive.html +138 -0
- package/github/docs/types/Subset.html +144 -0
- package/github/docs/types/UnrecognizedKeyArchive.html +138 -0
- package/github/docs/variables/CURRENT_ARCHIVE_VERSION.html +138 -0
- package/github/docs/variables/InsecureKeyArchiveCodec.html +138 -0
- package/github/docs/variables/InsecureKeyArchiveType.html +138 -0
- package/github/docs/variables/KeyArchiveCodec.html +138 -0
- package/github/docs/variables/KeyArchiveKeyInfoArrayCodec.html +138 -0
- package/github/docs/variables/KeyArchiveKeyInfoCodec.html +138 -0
- package/github/docs/variables/KeyArchiveKeyTypeCodec.html +138 -0
- package/github/docs/variables/SecureKeyArchiveCodec.html +138 -0
- package/github/docs/variables/SecureKeyArchiveType.html +138 -0
- package/github/docs/variables/UnrecognizedKeyArchiveCodec.html +138 -0
- package/github/package.json +25 -17
- package/github/src/sudoKeyArchive/sudoKeyArchive.ts +1 -1
- package/github/src/sudoKeyManager/sudoCryptoProvider.ts +44 -3
- package/github/src/sudoKeyManager/sudoKeyManager.ts +64 -6
- package/github/test/unit/sudoKeyManager.spec.ts +12 -12
- package/github/yarn.lock +1012 -735
- package/lib/sudoKeyArchive/sudoKeyArchive.d.ts +1 -1
- package/lib/sudoKeyArchive/sudoKeyArchive.js +1 -1
- package/lib/sudoKeyManager/sudoCryptoProvider.d.ts +34 -3
- package/lib/sudoKeyManager/sudoKeyManager.d.ts +32 -4
- package/lib/sudoKeyManager/sudoKeyManager.js +16 -4
- package/package.json +26 -18
- package/src/sudoKeyArchive/sudoKeyArchive.ts +1 -1
- package/src/sudoKeyManager/sudoCryptoProvider.ts +44 -3
- package/src/sudoKeyManager/sudoKeyManager.ts +64 -6
- package/test/unit/sudoKeyManager.spec.ts +12 -12
- package/yarn.lock +1012 -735
- package/docs/assets/icons.css +0 -1043
- package/docs/assets/icons.png +0 -0
- package/docs/assets/icons@2x.png +0 -0
- package/github/docs/assets/icons.css +0 -1043
- package/github/docs/assets/icons.png +0 -0
- package/github/docs/assets/icons@2x.png +0 -0
|
@@ -142,7 +142,7 @@ export declare class DefaultSudoKeyArchive implements SudoKeyArchive {
|
|
|
142
142
|
*
|
|
143
143
|
* @param excludedKeyTypes
|
|
144
144
|
* Set of key types to exclude from archive or restore operation.
|
|
145
|
-
* Default: {
|
|
145
|
+
* Default: {@link KeyArchiveKeyType.PublicKey}
|
|
146
146
|
*
|
|
147
147
|
* @param metaInfo
|
|
148
148
|
* Meta information to include with the key archive
|
|
@@ -81,7 +81,7 @@ class DefaultSudoKeyArchive {
|
|
|
81
81
|
*
|
|
82
82
|
* @param excludedKeyTypes
|
|
83
83
|
* Set of key types to exclude from archive or restore operation.
|
|
84
|
-
* Default: {
|
|
84
|
+
* Default: {@link KeyArchiveKeyType.PublicKey}
|
|
85
85
|
*
|
|
86
86
|
* @param metaInfo
|
|
87
87
|
* Meta information to include with the key archive
|
|
@@ -75,7 +75,7 @@ export interface SudoCryptoProvider {
|
|
|
75
75
|
*
|
|
76
76
|
* @param name The name of the symmetric key.
|
|
77
77
|
*/
|
|
78
|
-
|
|
78
|
+
doesSymmetricKeyExist(name: string): Promise<boolean>;
|
|
79
79
|
/**
|
|
80
80
|
* Deletes a symmetric key from the secure store.
|
|
81
81
|
*
|
|
@@ -114,6 +114,27 @@ export interface SudoCryptoProvider {
|
|
|
114
114
|
* @param name The name of the key pair to be deleted.
|
|
115
115
|
*/
|
|
116
116
|
deleteKeyPair(name: string): Promise<void>;
|
|
117
|
+
/**
|
|
118
|
+
* Generates a signature for the given data with the specified private key.
|
|
119
|
+
*
|
|
120
|
+
* @param name The name of the private key to use for generation.
|
|
121
|
+
* @param data The data to sign.
|
|
122
|
+
*
|
|
123
|
+
* @returns Data signature
|
|
124
|
+
*
|
|
125
|
+
* @throws {@link KeyNotFoundError}
|
|
126
|
+
*/
|
|
127
|
+
generateSignatureWithPrivateKey(name: string, data: ArrayBuffer): Promise<ArrayBuffer>;
|
|
128
|
+
/**
|
|
129
|
+
* Verifies the given data against the provided signature using the specified public key.
|
|
130
|
+
*
|
|
131
|
+
* @param name The name of the public key to use for validation.
|
|
132
|
+
* @param data The data to verify
|
|
133
|
+
* @param signature The signature to verify against
|
|
134
|
+
*
|
|
135
|
+
* @returns True if the data and signature could be successfully verified
|
|
136
|
+
*/
|
|
137
|
+
verifySignatureWithPublicKey(name: string, data: ArrayBuffer, signature: ArrayBuffer): Promise<boolean>;
|
|
117
138
|
/**
|
|
118
139
|
* Adds a private key to the secure store.
|
|
119
140
|
*
|
|
@@ -134,7 +155,7 @@ export interface SudoCryptoProvider {
|
|
|
134
155
|
*
|
|
135
156
|
* @param name The name of the private key.
|
|
136
157
|
*/
|
|
137
|
-
|
|
158
|
+
doesPrivateKeyExist(name: string): Promise<boolean>;
|
|
138
159
|
/**
|
|
139
160
|
* Adds a public key to the secure store.
|
|
140
161
|
*
|
|
@@ -142,6 +163,12 @@ export interface SudoCryptoProvider {
|
|
|
142
163
|
* @param name The name of the public key to be stored.
|
|
143
164
|
*/
|
|
144
165
|
addPublicKey(key: ArrayBuffer, name: string): Promise<void>;
|
|
166
|
+
/**
|
|
167
|
+
* Deletes the specified public key from the secure store.
|
|
168
|
+
*
|
|
169
|
+
* @param name The name of the public key to be removed.
|
|
170
|
+
*/
|
|
171
|
+
deletePublicKey(name: string): Promise<void>;
|
|
145
172
|
/**
|
|
146
173
|
* Retrieves the public key from the secure store.
|
|
147
174
|
*
|
|
@@ -176,6 +203,7 @@ export interface SudoCryptoProvider {
|
|
|
176
203
|
* @returns Encrypted data and IV
|
|
177
204
|
*
|
|
178
205
|
* @throws {@link UnrecognizedAlgorithmError}
|
|
206
|
+
* @throws {@link KeyNotFoundError}
|
|
179
207
|
*/
|
|
180
208
|
encryptWithSymmetricKeyName(name: string, data: ArrayBuffer, options?: SymmetricEncryptionOptions): Promise<ArrayBuffer>;
|
|
181
209
|
/**
|
|
@@ -199,6 +227,7 @@ export interface SudoCryptoProvider {
|
|
|
199
227
|
* @returns Decrypted data
|
|
200
228
|
*
|
|
201
229
|
* @throws {@link UnrecognizedAlgorithmError}
|
|
230
|
+
* @throws {@link KeyNotFoundError}
|
|
202
231
|
*/
|
|
203
232
|
decryptWithSymmetricKeyName(name: string, data: ArrayBuffer, options?: SymmetricEncryptionOptions): Promise<ArrayBuffer>;
|
|
204
233
|
/**
|
|
@@ -256,6 +285,7 @@ export interface SudoCryptoProvider {
|
|
|
256
285
|
* @returns Encrypted data
|
|
257
286
|
*
|
|
258
287
|
* @throws {@link UnrecognizedAlgorithmError}
|
|
288
|
+
* @throws {@link KeyNotFoundError}
|
|
259
289
|
*/
|
|
260
290
|
encryptWithPublicKey(name: string, data: ArrayBuffer, options?: AsymmetricEncryptionOptions): Promise<ArrayBuffer>;
|
|
261
291
|
/**
|
|
@@ -264,9 +294,10 @@ export interface SudoCryptoProvider {
|
|
|
264
294
|
* @param name The name of the private key to use for decryption.
|
|
265
295
|
* @param data The data to decrypt.
|
|
266
296
|
*
|
|
267
|
-
* @returns Decrypted data
|
|
297
|
+
* @returns Decrypted data.
|
|
268
298
|
*
|
|
269
299
|
* @throws {@link UnrecognizedAlgorithmError}
|
|
300
|
+
* @throws {@link KeyNotFoundError}
|
|
270
301
|
*/
|
|
271
302
|
decryptWithPrivateKey(name: string, data: ArrayBuffer, options?: AsymmetricEncryptionOptions): Promise<ArrayBuffer>;
|
|
272
303
|
/**
|
|
@@ -56,7 +56,7 @@ export interface SudoKeyManager {
|
|
|
56
56
|
*
|
|
57
57
|
* @param name The name of the symmetric key.
|
|
58
58
|
*/
|
|
59
|
-
|
|
59
|
+
doesSymmetricKeyExist(name: string): Promise<boolean>;
|
|
60
60
|
/**
|
|
61
61
|
* Deletes a symmetric key from the secure store.
|
|
62
62
|
*
|
|
@@ -83,7 +83,7 @@ export interface SudoKeyManager {
|
|
|
83
83
|
*
|
|
84
84
|
* @param name The name of the private key.
|
|
85
85
|
*/
|
|
86
|
-
|
|
86
|
+
doesPrivateKeyExist(name: string): Promise<boolean>;
|
|
87
87
|
/**
|
|
88
88
|
* Adds a public key to the secure store.
|
|
89
89
|
*
|
|
@@ -93,6 +93,12 @@ export interface SudoKeyManager {
|
|
|
93
93
|
* @param name The name of the public key to be stored.
|
|
94
94
|
*/
|
|
95
95
|
addPublicKey(key: ArrayBuffer, name: string): Promise<void>;
|
|
96
|
+
/**
|
|
97
|
+
* Deletes the specified public key from the secure store.
|
|
98
|
+
*
|
|
99
|
+
* @param name The name of the public key to be removed.
|
|
100
|
+
*/
|
|
101
|
+
deletePublicKey(name: string): Promise<void>;
|
|
96
102
|
/**
|
|
97
103
|
* Retrieves the public key from the secure store.
|
|
98
104
|
*
|
|
@@ -109,6 +115,25 @@ export interface SudoKeyManager {
|
|
|
109
115
|
* @param name The name of the key pair to be deleted.
|
|
110
116
|
*/
|
|
111
117
|
deleteKeyPair(name: string): Promise<void>;
|
|
118
|
+
/**
|
|
119
|
+
* Generates a signature for the given data with the specified private key.
|
|
120
|
+
*
|
|
121
|
+
* @param name The name of the private key to use for generation.
|
|
122
|
+
* @param data The data to sign.
|
|
123
|
+
*
|
|
124
|
+
* @returns Data signature or undefined if the private key is not found.
|
|
125
|
+
*/
|
|
126
|
+
generateSignatureWithPrivateKey(name: string, data: ArrayBuffer): Promise<ArrayBuffer>;
|
|
127
|
+
/**
|
|
128
|
+
* Verifies the given data against the provided signature using the specified public key.
|
|
129
|
+
*
|
|
130
|
+
* @param name The name of the public key to use for validation.
|
|
131
|
+
* @param data The data to verify
|
|
132
|
+
* @param signature The signature to verify against
|
|
133
|
+
*
|
|
134
|
+
* @returns True if the data and signature could be successfully verified
|
|
135
|
+
*/
|
|
136
|
+
verifySignatureWithPublicKey(name: string, data: ArrayBuffer, signature: ArrayBuffer): Promise<boolean>;
|
|
112
137
|
/**
|
|
113
138
|
* @deprecated Use version with `options` param.
|
|
114
139
|
*
|
|
@@ -290,15 +315,18 @@ export declare class DefaultSudoKeyManager implements SudoKeyManager {
|
|
|
290
315
|
updatePassword(password: ArrayBuffer, name: string): Promise<void>;
|
|
291
316
|
addSymmetricKey(key: ArrayBuffer, name: string): Promise<void>;
|
|
292
317
|
getSymmetricKey(name: string): Promise<ArrayBuffer | undefined>;
|
|
293
|
-
|
|
318
|
+
doesSymmetricKeyExist(name: string): Promise<boolean>;
|
|
294
319
|
deleteSymmetricKey(name: string): Promise<void>;
|
|
295
320
|
generateKeyPair(name: string): Promise<void>;
|
|
296
321
|
addPrivateKey(key: ArrayBuffer, name: string): Promise<void>;
|
|
297
322
|
getPrivateKey(name: string): Promise<ArrayBuffer | undefined>;
|
|
298
|
-
|
|
323
|
+
doesPrivateKeyExist(name: string): Promise<boolean>;
|
|
299
324
|
addPublicKey(key: ArrayBuffer, name: string): Promise<void>;
|
|
325
|
+
deletePublicKey(name: string): Promise<void>;
|
|
300
326
|
getPublicKey(name: string): Promise<PublicKey | undefined>;
|
|
301
327
|
deleteKeyPair(name: string): Promise<void>;
|
|
328
|
+
generateSignatureWithPrivateKey(name: string, data: ArrayBuffer): Promise<ArrayBuffer>;
|
|
329
|
+
verifySignatureWithPublicKey(name: string, data: ArrayBuffer, signature: ArrayBuffer): Promise<boolean>;
|
|
302
330
|
encryptWithSymmetricKey(key: ArrayBuffer, data: ArrayBuffer, ivOrOptions?: ArrayBuffer | SymmetricEncryptionOptions): Promise<ArrayBuffer>;
|
|
303
331
|
decryptWithSymmetricKey(key: ArrayBuffer, data: ArrayBuffer, ivOrOptions?: ArrayBuffer | SymmetricEncryptionOptions): Promise<ArrayBuffer>;
|
|
304
332
|
encryptWithSymmetricKeyName(name: string, data: ArrayBuffer, ivOrOptions?: ArrayBuffer | SymmetricEncryptionOptions): Promise<ArrayBuffer>;
|
|
@@ -49,8 +49,8 @@ class DefaultSudoKeyManager {
|
|
|
49
49
|
return this.sudoCryptoProvider.getSymmetricKey(name);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
return this.sudoCryptoProvider.
|
|
52
|
+
doesSymmetricKeyExist(name) {
|
|
53
|
+
return this.sudoCryptoProvider.doesSymmetricKeyExist(name);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
deleteSymmetricKey(name) {
|
|
@@ -69,14 +69,18 @@ class DefaultSudoKeyManager {
|
|
|
69
69
|
return this.sudoCryptoProvider.getPrivateKey(name);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
return this.sudoCryptoProvider.
|
|
72
|
+
doesPrivateKeyExist(name) {
|
|
73
|
+
return this.sudoCryptoProvider.doesPrivateKeyExist(name);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
addPublicKey(key, name) {
|
|
77
77
|
return this.sudoCryptoProvider.addPublicKey(key, name);
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
deletePublicKey(name) {
|
|
81
|
+
return this.sudoCryptoProvider.deletePublicKey(name);
|
|
82
|
+
}
|
|
83
|
+
|
|
80
84
|
getPublicKey(name) {
|
|
81
85
|
return this.sudoCryptoProvider.getPublicKey(name);
|
|
82
86
|
}
|
|
@@ -85,6 +89,14 @@ class DefaultSudoKeyManager {
|
|
|
85
89
|
return this.sudoCryptoProvider.deleteKeyPair(name);
|
|
86
90
|
}
|
|
87
91
|
|
|
92
|
+
generateSignatureWithPrivateKey(name, data) {
|
|
93
|
+
return this.sudoCryptoProvider.generateSignatureWithPrivateKey(name, data);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
verifySignatureWithPublicKey(name, data, signature) {
|
|
97
|
+
return this.sudoCryptoProvider.verifySignatureWithPublicKey(name, data, signature);
|
|
98
|
+
}
|
|
99
|
+
|
|
88
100
|
encryptWithSymmetricKey(key, data, ivOrOptions) {
|
|
89
101
|
if (_buffer.Buffer.isArrayBuffer(ivOrOptions)) {
|
|
90
102
|
return this.sudoCryptoProvider.encryptWithSymmetricKey(key, data, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sudoplatform/sudo-common",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.2",
|
|
4
4
|
"author": "Anonyome Labs, Inc.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -44,40 +44,48 @@
|
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"apollo-client": "^2.6.10",
|
|
47
|
-
"aws-sdk": "^2.
|
|
47
|
+
"aws-sdk": "^2.1181.0",
|
|
48
48
|
"browser-bunyan": "^1.8.0",
|
|
49
49
|
"fflate": "^0.7.3",
|
|
50
50
|
"graphql": "^15.8.0"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"io-ts": "^2.2.
|
|
53
|
+
"io-ts": "^2.2.16"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@babel/cli": "^7.
|
|
57
|
-
"@babel/core": "^7.
|
|
58
|
-
"@babel/plugin-proposal-class-properties": "^7.
|
|
59
|
-
"@babel/plugin-proposal-private-methods": "^7.
|
|
60
|
-
"@babel/preset-env": "^7.
|
|
61
|
-
"@babel/preset-typescript": "^7.
|
|
62
|
-
"@types/jest": "^27.5.
|
|
63
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
64
|
-
"@typescript-eslint/parser": "^5.
|
|
56
|
+
"@babel/cli": "^7.18.9",
|
|
57
|
+
"@babel/core": "^7.18.9",
|
|
58
|
+
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
59
|
+
"@babel/plugin-proposal-private-methods": "^7.18.6",
|
|
60
|
+
"@babel/preset-env": "^7.18.9",
|
|
61
|
+
"@babel/preset-typescript": "^7.18.6",
|
|
62
|
+
"@types/jest": "^27.5.2",
|
|
63
|
+
"@typescript-eslint/eslint-plugin": "^5.30.7",
|
|
64
|
+
"@typescript-eslint/parser": "^5.30.7",
|
|
65
65
|
"aws-sdk-mock": "^5.7.0",
|
|
66
|
-
"eslint": "^8.
|
|
66
|
+
"eslint": "^8.20.0",
|
|
67
67
|
"eslint-config-prettier": "^8.5.0",
|
|
68
68
|
"eslint-plugin-import": "^2.26.0",
|
|
69
|
-
"eslint-plugin-prettier": "^4.
|
|
70
|
-
"fp-ts": "^2.
|
|
69
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
70
|
+
"fp-ts": "^2.12.1",
|
|
71
71
|
"io-ts": "^2.2.16",
|
|
72
72
|
"io-ts-types": "^0.5.16",
|
|
73
73
|
"isomorphic-webcrypto": "^2.3.8",
|
|
74
74
|
"jest": "^27.5.1",
|
|
75
75
|
"monocle-ts": "^2.3.13",
|
|
76
76
|
"newtype-ts": "^0.3.5",
|
|
77
|
-
"prettier": "^2.
|
|
77
|
+
"prettier": "^2.7.1",
|
|
78
78
|
"rimraf": "^3.0.2",
|
|
79
79
|
"ts-mockito": "^2.6.1",
|
|
80
|
-
"typedoc": "^0.
|
|
81
|
-
"typescript": "^4.
|
|
80
|
+
"typedoc": "^0.23.9",
|
|
81
|
+
"typescript": "^4.7.4"
|
|
82
|
+
},
|
|
83
|
+
"outdatedSuppressions": {
|
|
84
|
+
"major": {
|
|
85
|
+
"@types/jest": 1661135936,
|
|
86
|
+
"ansi-regex": 1661135937,
|
|
87
|
+
"graphql": 1661135937,
|
|
88
|
+
"jest": 1661135937
|
|
89
|
+
}
|
|
82
90
|
}
|
|
83
91
|
}
|
|
@@ -195,7 +195,7 @@ export class DefaultSudoKeyArchive implements SudoKeyArchive {
|
|
|
195
195
|
*
|
|
196
196
|
* @param excludedKeyTypes
|
|
197
197
|
* Set of key types to exclude from archive or restore operation.
|
|
198
|
-
* Default: {
|
|
198
|
+
* Default: {@link KeyArchiveKeyType.PublicKey}
|
|
199
199
|
*
|
|
200
200
|
* @param metaInfo
|
|
201
201
|
* Meta information to include with the key archive
|
|
@@ -91,7 +91,7 @@ export interface SudoCryptoProvider {
|
|
|
91
91
|
*
|
|
92
92
|
* @param name The name of the symmetric key.
|
|
93
93
|
*/
|
|
94
|
-
|
|
94
|
+
doesSymmetricKeyExist(name: string): Promise<boolean>
|
|
95
95
|
|
|
96
96
|
/**
|
|
97
97
|
* Deletes a symmetric key from the secure store.
|
|
@@ -138,6 +138,36 @@ export interface SudoCryptoProvider {
|
|
|
138
138
|
*/
|
|
139
139
|
deleteKeyPair(name: string): Promise<void>
|
|
140
140
|
|
|
141
|
+
/**
|
|
142
|
+
* Generates a signature for the given data with the specified private key.
|
|
143
|
+
*
|
|
144
|
+
* @param name The name of the private key to use for generation.
|
|
145
|
+
* @param data The data to sign.
|
|
146
|
+
*
|
|
147
|
+
* @returns Data signature
|
|
148
|
+
*
|
|
149
|
+
* @throws {@link KeyNotFoundError}
|
|
150
|
+
*/
|
|
151
|
+
generateSignatureWithPrivateKey(
|
|
152
|
+
name: string,
|
|
153
|
+
data: ArrayBuffer,
|
|
154
|
+
): Promise<ArrayBuffer>
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Verifies the given data against the provided signature using the specified public key.
|
|
158
|
+
*
|
|
159
|
+
* @param name The name of the public key to use for validation.
|
|
160
|
+
* @param data The data to verify
|
|
161
|
+
* @param signature The signature to verify against
|
|
162
|
+
*
|
|
163
|
+
* @returns True if the data and signature could be successfully verified
|
|
164
|
+
*/
|
|
165
|
+
verifySignatureWithPublicKey(
|
|
166
|
+
name: string,
|
|
167
|
+
data: ArrayBuffer,
|
|
168
|
+
signature: ArrayBuffer,
|
|
169
|
+
): Promise<boolean>
|
|
170
|
+
|
|
141
171
|
/**
|
|
142
172
|
* Adds a private key to the secure store.
|
|
143
173
|
*
|
|
@@ -160,7 +190,7 @@ export interface SudoCryptoProvider {
|
|
|
160
190
|
*
|
|
161
191
|
* @param name The name of the private key.
|
|
162
192
|
*/
|
|
163
|
-
|
|
193
|
+
doesPrivateKeyExist(name: string): Promise<boolean>
|
|
164
194
|
|
|
165
195
|
/**
|
|
166
196
|
* Adds a public key to the secure store.
|
|
@@ -170,6 +200,13 @@ export interface SudoCryptoProvider {
|
|
|
170
200
|
*/
|
|
171
201
|
addPublicKey(key: ArrayBuffer, name: string): Promise<void>
|
|
172
202
|
|
|
203
|
+
/**
|
|
204
|
+
* Deletes the specified public key from the secure store.
|
|
205
|
+
*
|
|
206
|
+
* @param name The name of the public key to be removed.
|
|
207
|
+
*/
|
|
208
|
+
deletePublicKey(name: string): Promise<void>
|
|
209
|
+
|
|
173
210
|
/**
|
|
174
211
|
* Retrieves the public key from the secure store.
|
|
175
212
|
*
|
|
@@ -211,6 +248,7 @@ export interface SudoCryptoProvider {
|
|
|
211
248
|
* @returns Encrypted data and IV
|
|
212
249
|
*
|
|
213
250
|
* @throws {@link UnrecognizedAlgorithmError}
|
|
251
|
+
* @throws {@link KeyNotFoundError}
|
|
214
252
|
*/
|
|
215
253
|
encryptWithSymmetricKeyName(
|
|
216
254
|
name: string,
|
|
@@ -244,6 +282,7 @@ export interface SudoCryptoProvider {
|
|
|
244
282
|
* @returns Decrypted data
|
|
245
283
|
*
|
|
246
284
|
* @throws {@link UnrecognizedAlgorithmError}
|
|
285
|
+
* @throws {@link KeyNotFoundError}
|
|
247
286
|
*/
|
|
248
287
|
decryptWithSymmetricKeyName(
|
|
249
288
|
name: string,
|
|
@@ -326,6 +365,7 @@ export interface SudoCryptoProvider {
|
|
|
326
365
|
* @returns Encrypted data
|
|
327
366
|
*
|
|
328
367
|
* @throws {@link UnrecognizedAlgorithmError}
|
|
368
|
+
* @throws {@link KeyNotFoundError}
|
|
329
369
|
*/
|
|
330
370
|
encryptWithPublicKey(
|
|
331
371
|
name: string,
|
|
@@ -339,9 +379,10 @@ export interface SudoCryptoProvider {
|
|
|
339
379
|
* @param name The name of the private key to use for decryption.
|
|
340
380
|
* @param data The data to decrypt.
|
|
341
381
|
*
|
|
342
|
-
* @returns Decrypted data
|
|
382
|
+
* @returns Decrypted data.
|
|
343
383
|
*
|
|
344
384
|
* @throws {@link UnrecognizedAlgorithmError}
|
|
385
|
+
* @throws {@link KeyNotFoundError}
|
|
345
386
|
*/
|
|
346
387
|
decryptWithPrivateKey(
|
|
347
388
|
name: string,
|
|
@@ -68,7 +68,7 @@ export interface SudoKeyManager {
|
|
|
68
68
|
*
|
|
69
69
|
* @param name The name of the symmetric key.
|
|
70
70
|
*/
|
|
71
|
-
|
|
71
|
+
doesSymmetricKeyExist(name: string): Promise<boolean>
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
74
|
* Deletes a symmetric key from the secure store.
|
|
@@ -99,7 +99,7 @@ export interface SudoKeyManager {
|
|
|
99
99
|
*
|
|
100
100
|
* @param name The name of the private key.
|
|
101
101
|
*/
|
|
102
|
-
|
|
102
|
+
doesPrivateKeyExist(name: string): Promise<boolean>
|
|
103
103
|
|
|
104
104
|
/**
|
|
105
105
|
* Adds a public key to the secure store.
|
|
@@ -111,6 +111,13 @@ export interface SudoKeyManager {
|
|
|
111
111
|
*/
|
|
112
112
|
addPublicKey(key: ArrayBuffer, name: string): Promise<void>
|
|
113
113
|
|
|
114
|
+
/**
|
|
115
|
+
* Deletes the specified public key from the secure store.
|
|
116
|
+
*
|
|
117
|
+
* @param name The name of the public key to be removed.
|
|
118
|
+
*/
|
|
119
|
+
deletePublicKey(name: string): Promise<void>
|
|
120
|
+
|
|
114
121
|
/**
|
|
115
122
|
* Retrieves the public key from the secure store.
|
|
116
123
|
*
|
|
@@ -129,6 +136,34 @@ export interface SudoKeyManager {
|
|
|
129
136
|
*/
|
|
130
137
|
deleteKeyPair(name: string): Promise<void>
|
|
131
138
|
|
|
139
|
+
/**
|
|
140
|
+
* Generates a signature for the given data with the specified private key.
|
|
141
|
+
*
|
|
142
|
+
* @param name The name of the private key to use for generation.
|
|
143
|
+
* @param data The data to sign.
|
|
144
|
+
*
|
|
145
|
+
* @returns Data signature or undefined if the private key is not found.
|
|
146
|
+
*/
|
|
147
|
+
generateSignatureWithPrivateKey(
|
|
148
|
+
name: string,
|
|
149
|
+
data: ArrayBuffer,
|
|
150
|
+
): Promise<ArrayBuffer>
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Verifies the given data against the provided signature using the specified public key.
|
|
154
|
+
*
|
|
155
|
+
* @param name The name of the public key to use for validation.
|
|
156
|
+
* @param data The data to verify
|
|
157
|
+
* @param signature The signature to verify against
|
|
158
|
+
*
|
|
159
|
+
* @returns True if the data and signature could be successfully verified
|
|
160
|
+
*/
|
|
161
|
+
verifySignatureWithPublicKey(
|
|
162
|
+
name: string,
|
|
163
|
+
data: ArrayBuffer,
|
|
164
|
+
signature: ArrayBuffer,
|
|
165
|
+
): Promise<boolean>
|
|
166
|
+
|
|
132
167
|
/**
|
|
133
168
|
* @deprecated Use version with `options` param.
|
|
134
169
|
*
|
|
@@ -393,8 +428,8 @@ export class DefaultSudoKeyManager implements SudoKeyManager {
|
|
|
393
428
|
return this.sudoCryptoProvider.getSymmetricKey(name)
|
|
394
429
|
}
|
|
395
430
|
|
|
396
|
-
public
|
|
397
|
-
return this.sudoCryptoProvider.
|
|
431
|
+
public doesSymmetricKeyExist(name: string): Promise<boolean> {
|
|
432
|
+
return this.sudoCryptoProvider.doesSymmetricKeyExist(name)
|
|
398
433
|
}
|
|
399
434
|
|
|
400
435
|
public deleteSymmetricKey(name: string): Promise<void> {
|
|
@@ -413,14 +448,18 @@ export class DefaultSudoKeyManager implements SudoKeyManager {
|
|
|
413
448
|
return this.sudoCryptoProvider.getPrivateKey(name)
|
|
414
449
|
}
|
|
415
450
|
|
|
416
|
-
public
|
|
417
|
-
return this.sudoCryptoProvider.
|
|
451
|
+
public doesPrivateKeyExist(name: string): Promise<boolean> {
|
|
452
|
+
return this.sudoCryptoProvider.doesPrivateKeyExist(name)
|
|
418
453
|
}
|
|
419
454
|
|
|
420
455
|
public addPublicKey(key: ArrayBuffer, name: string): Promise<void> {
|
|
421
456
|
return this.sudoCryptoProvider.addPublicKey(key, name)
|
|
422
457
|
}
|
|
423
458
|
|
|
459
|
+
public deletePublicKey(name: string): Promise<void> {
|
|
460
|
+
return this.sudoCryptoProvider.deletePublicKey(name)
|
|
461
|
+
}
|
|
462
|
+
|
|
424
463
|
public getPublicKey(name: string): Promise<PublicKey | undefined> {
|
|
425
464
|
return this.sudoCryptoProvider.getPublicKey(name)
|
|
426
465
|
}
|
|
@@ -429,6 +468,25 @@ export class DefaultSudoKeyManager implements SudoKeyManager {
|
|
|
429
468
|
return this.sudoCryptoProvider.deleteKeyPair(name)
|
|
430
469
|
}
|
|
431
470
|
|
|
471
|
+
public generateSignatureWithPrivateKey(
|
|
472
|
+
name: string,
|
|
473
|
+
data: ArrayBuffer,
|
|
474
|
+
): Promise<ArrayBuffer> {
|
|
475
|
+
return this.sudoCryptoProvider.generateSignatureWithPrivateKey(name, data)
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
verifySignatureWithPublicKey(
|
|
479
|
+
name: string,
|
|
480
|
+
data: ArrayBuffer,
|
|
481
|
+
signature: ArrayBuffer,
|
|
482
|
+
): Promise<boolean> {
|
|
483
|
+
return this.sudoCryptoProvider.verifySignatureWithPublicKey(
|
|
484
|
+
name,
|
|
485
|
+
data,
|
|
486
|
+
signature,
|
|
487
|
+
)
|
|
488
|
+
}
|
|
489
|
+
|
|
432
490
|
public encryptWithSymmetricKey(
|
|
433
491
|
key: ArrayBuffer,
|
|
434
492
|
data: ArrayBuffer,
|
|
@@ -177,21 +177,21 @@ describe('DefaultSudoKeyManager', () => {
|
|
|
177
177
|
})
|
|
178
178
|
})
|
|
179
179
|
|
|
180
|
-
describe('
|
|
181
|
-
it('should call crypto provider
|
|
180
|
+
describe('doesSymmetricKeyExist', () => {
|
|
181
|
+
it('should call crypto provider doesSymmetricKeyExist', async () => {
|
|
182
182
|
when(
|
|
183
|
-
sudoCryptoProviderMock.
|
|
183
|
+
sudoCryptoProviderMock.doesSymmetricKeyExist(anything()),
|
|
184
184
|
).thenResolve(true)
|
|
185
185
|
|
|
186
186
|
await expect(
|
|
187
|
-
sudoKeyManager.
|
|
187
|
+
sudoKeyManager.doesSymmetricKeyExist('VpnKey'),
|
|
188
188
|
).resolves.toEqual(true)
|
|
189
189
|
const [actualKey] = capture(
|
|
190
|
-
sudoCryptoProviderMock.
|
|
190
|
+
sudoCryptoProviderMock.doesSymmetricKeyExist,
|
|
191
191
|
).first()
|
|
192
192
|
expect(actualKey).toStrictEqual('VpnKey')
|
|
193
193
|
|
|
194
|
-
verify(sudoCryptoProviderMock.
|
|
194
|
+
verify(sudoCryptoProviderMock.doesSymmetricKeyExist(anything())).once()
|
|
195
195
|
})
|
|
196
196
|
})
|
|
197
197
|
|
|
@@ -281,22 +281,22 @@ describe('DefaultSudoKeyManager', () => {
|
|
|
281
281
|
})
|
|
282
282
|
})
|
|
283
283
|
|
|
284
|
-
describe('
|
|
285
|
-
it('should call crypto provider
|
|
286
|
-
when(sudoCryptoProviderMock.
|
|
284
|
+
describe('doesPrivateKeyExist', () => {
|
|
285
|
+
it('should call crypto provider doesPrivateKeyExist', async () => {
|
|
286
|
+
when(sudoCryptoProviderMock.doesPrivateKeyExist(anything())).thenResolve(
|
|
287
287
|
true,
|
|
288
288
|
)
|
|
289
289
|
|
|
290
290
|
await expect(
|
|
291
|
-
sudoKeyManager.
|
|
291
|
+
sudoKeyManager.doesPrivateKeyExist('VpnKeyPair'),
|
|
292
292
|
).resolves.toBeTruthy()
|
|
293
293
|
|
|
294
294
|
const [actualKeyName] = capture(
|
|
295
|
-
sudoCryptoProviderMock.
|
|
295
|
+
sudoCryptoProviderMock.doesPrivateKeyExist,
|
|
296
296
|
).first()
|
|
297
297
|
expect(actualKeyName).toStrictEqual('VpnKeyPair')
|
|
298
298
|
|
|
299
|
-
verify(sudoCryptoProviderMock.
|
|
299
|
+
verify(sudoCryptoProviderMock.doesPrivateKeyExist(anything())).once()
|
|
300
300
|
})
|
|
301
301
|
})
|
|
302
302
|
|