cas-typescript-sdk 1.0.54 → 1.0.56
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.d.ts +6 -0
- package/index.darwin-x64.node +0 -0
- package/index.js +55 -52
- package/index.linux-x64-gnu.node +0 -0
- package/index.linux-x64-musl.node +0 -0
- package/index.win32-x64-msvc.node +0 -0
- package/lib/asymmetric/RSAWrapper.d.ts +1 -1
- package/lib/asymmetric/RSAWrapper.d.ts.map +1 -1
- package/lib/asymmetric/RSAWrapper.js +25 -5
- package/lib/asymmetric/RSAWrapper.js.map +1 -1
- package/lib/asymmetric/index.d.ts +3 -2
- package/lib/asymmetric/index.d.ts.map +1 -1
- package/lib/asymmetric/index.js +5 -2
- package/lib/asymmetric/index.js.map +1 -1
- package/lib/cas-configuration.d.ts +20 -0
- package/lib/cas-configuration.d.ts.map +1 -0
- package/lib/cas-configuration.js +44 -0
- package/lib/cas-configuration.js.map +1 -0
- package/lib/decorators/benchmark-method.d.ts +2 -0
- package/lib/decorators/benchmark-method.d.ts.map +1 -0
- package/lib/decorators/benchmark-method.js +29 -0
- package/lib/decorators/benchmark-method.js.map +1 -0
- package/lib/digital-signature/digital-siganture-sha-512.d.ts +2 -2
- package/lib/digital-signature/digital-siganture-sha-512.d.ts.map +1 -1
- package/lib/digital-signature/digital-siganture-sha-512.js +18 -4
- package/lib/digital-signature/digital-siganture-sha-512.js.map +1 -1
- package/lib/digital-signature/digital-signature-base.d.ts +1 -1
- package/lib/digital-signature/digital-signature-base.d.ts.map +1 -1
- package/lib/digital-signature/digital-signature-base.js +2 -1
- package/lib/digital-signature/digital-signature-factory.d.ts +1 -1
- package/lib/digital-signature/digital-signature-factory.d.ts.map +1 -1
- package/lib/digital-signature/digital-signature-factory.js +11 -7
- package/lib/digital-signature/digital-signature-factory.js.map +1 -1
- package/lib/digital-signature/digital-signaturte-sha-256.d.ts +4 -4
- package/lib/digital-signature/digital-signaturte-sha-256.d.ts.map +1 -1
- package/lib/digital-signature/digital-signaturte-sha-256.js +23 -6
- package/lib/digital-signature/digital-signaturte-sha-256.js.map +1 -1
- package/lib/digital-signature/index.d.ts +5 -5
- package/lib/digital-signature/index.d.ts.map +1 -1
- package/lib/digital-signature/index.js +11 -6
- package/lib/digital-signature/index.js.map +1 -1
- package/lib/hashers/blake2-wrapper.d.ts +1 -1
- package/lib/hashers/blake2-wrapper.d.ts.map +1 -1
- package/lib/hashers/blake2-wrapper.js +29 -6
- package/lib/hashers/blake2-wrapper.js.map +1 -1
- package/lib/hashers/hasher-base.js +2 -1
- package/lib/hashers/hasher-factory.d.ts +1 -1
- package/lib/hashers/hasher-factory.d.ts.map +1 -1
- package/lib/hashers/hasher-factory.js +11 -7
- package/lib/hashers/hasher-factory.js.map +1 -1
- package/lib/hashers/hasher-type.js +5 -2
- package/lib/hashers/hasher-type.js.map +1 -1
- package/lib/hashers/index.d.ts +4 -4
- package/lib/hashers/index.d.ts.map +1 -1
- package/lib/hashers/index.js +11 -5
- package/lib/hashers/index.js.map +1 -1
- package/lib/hashers/sha-wrapper.d.ts +1 -1
- package/lib/hashers/sha-wrapper.d.ts.map +1 -1
- package/lib/hashers/sha-wrapper.js +29 -6
- package/lib/hashers/sha-wrapper.js.map +1 -1
- package/lib/http/http-wrapper.d.ts +6 -0
- package/lib/http/http-wrapper.d.ts.map +1 -0
- package/lib/http/http-wrapper.js +30 -0
- package/lib/http/http-wrapper.js.map +1 -0
- package/lib/hybrid/hpke.d.ts +1 -1
- package/lib/hybrid/hpke.d.ts.map +1 -1
- package/lib/hybrid/hpke.js +29 -6
- package/lib/hybrid/hpke.js.map +1 -1
- package/lib/hybrid/index.d.ts +1 -1
- package/lib/hybrid/index.d.ts.map +1 -1
- package/lib/hybrid/index.js +5 -2
- package/lib/hybrid/index.js.map +1 -1
- package/lib/index.d.ts +12 -41
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +32 -41
- package/lib/index.js.map +1 -1
- package/lib/key_exchange/index.d.ts +2 -2
- package/lib/key_exchange/index.d.ts.map +1 -1
- package/lib/key_exchange/index.js +5 -3
- package/lib/key_exchange/index.js.map +1 -1
- package/lib/key_exchange/x25519.d.ts +1 -1
- package/lib/key_exchange/x25519.d.ts.map +1 -1
- package/lib/key_exchange/x25519.js +21 -4
- package/lib/key_exchange/x25519.js.map +1 -1
- package/lib/message/hmac.d.ts.map +1 -1
- package/lib/message/hmac.js +21 -4
- package/lib/message/hmac.js.map +1 -1
- package/lib/message/index.d.ts +1 -1
- package/lib/message/index.d.ts.map +1 -1
- package/lib/message/index.js +5 -2
- package/lib/message/index.js.map +1 -1
- package/lib/password-hashers/argon2-wrapper.d.ts +1 -1
- package/lib/password-hashers/argon2-wrapper.d.ts.map +1 -1
- package/lib/password-hashers/argon2-wrapper.js +22 -5
- package/lib/password-hashers/argon2-wrapper.js.map +1 -1
- package/lib/password-hashers/bcrypt-wrapper.d.ts +1 -1
- package/lib/password-hashers/bcrypt-wrapper.d.ts.map +1 -1
- package/lib/password-hashers/bcrypt-wrapper.js +25 -5
- package/lib/password-hashers/bcrypt-wrapper.js.map +1 -1
- package/lib/password-hashers/index.d.ts +5 -5
- package/lib/password-hashers/index.d.ts.map +1 -1
- package/lib/password-hashers/index.js +13 -6
- package/lib/password-hashers/index.js.map +1 -1
- package/lib/password-hashers/password-hasher-base.js +2 -1
- package/lib/password-hashers/password-hasher-factory.d.ts +1 -1
- package/lib/password-hashers/password-hasher-factory.d.ts.map +1 -1
- package/lib/password-hashers/password-hasher-factory.js +14 -10
- package/lib/password-hashers/password-hasher-factory.js.map +1 -1
- package/lib/password-hashers/password-hasher-type.js +5 -2
- package/lib/password-hashers/password-hasher-type.js.map +1 -1
- package/lib/password-hashers/scrypt-wrapper.d.ts +1 -1
- package/lib/password-hashers/scrypt-wrapper.d.ts.map +1 -1
- package/lib/password-hashers/scrypt-wrapper.js +25 -5
- package/lib/password-hashers/scrypt-wrapper.js.map +1 -1
- package/lib/signature/ed25519-wrapper.d.ts +2 -2
- package/lib/signature/ed25519-wrapper.d.ts.map +1 -1
- package/lib/signature/ed25519-wrapper.js +25 -5
- package/lib/signature/ed25519-wrapper.js.map +1 -1
- package/lib/signature/index.d.ts +1 -1
- package/lib/signature/index.d.ts.map +1 -1
- package/lib/signature/index.js +5 -2
- package/lib/signature/index.js.map +1 -1
- package/lib/sponges/ascon-wrapper.d.ts.map +1 -1
- package/lib/sponges/ascon-wrapper.js +29 -6
- package/lib/sponges/ascon-wrapper.js.map +1 -1
- package/lib/sponges/index.d.ts +1 -1
- package/lib/sponges/index.d.ts.map +1 -1
- package/lib/sponges/index.js +5 -2
- package/lib/sponges/index.js.map +1 -1
- package/lib/symmetric/aes-wrapper.d.ts.map +1 -1
- package/lib/symmetric/aes-wrapper.js +49 -11
- package/lib/symmetric/aes-wrapper.js.map +1 -1
- package/lib/symmetric/index.d.ts +1 -1
- package/lib/symmetric/index.d.ts.map +1 -1
- package/lib/symmetric/index.js +5 -2
- package/lib/symmetric/index.js.map +1 -1
- package/package.json +2 -3
package/index.d.ts
CHANGED
|
@@ -118,6 +118,12 @@ export declare function scryptHashParams(password: string, cpuMemoryCost: number
|
|
|
118
118
|
|
|
119
119
|
export declare function scryptVerify(hashedPassword: string, passwordToVerify: string): boolean
|
|
120
120
|
|
|
121
|
+
export declare function sendBenchmarkToApi(timeInMilliseconds: number, className: string, methodName: string): void
|
|
122
|
+
|
|
123
|
+
export declare function setApiKey(apiKey: string): boolean
|
|
124
|
+
|
|
125
|
+
export declare function setBaseUrl(baseUrl: string): void
|
|
126
|
+
|
|
121
127
|
export declare function sha256(dataToHash: Array<number>): Array<number>
|
|
122
128
|
|
|
123
129
|
export declare function sha256RsaDigitalSignature(rsaKeySize: number, dataToSign: Array<number>): CASRSADigitalSignatureResult
|
package/index.darwin-x64.node
CHANGED
|
Binary file
|
package/index.js
CHANGED
|
@@ -77,8 +77,8 @@ function requireNative() {
|
|
|
77
77
|
try {
|
|
78
78
|
const binding = require('cas-typescript-sdk-android-arm64')
|
|
79
79
|
const bindingPackageVersion = require('cas-typescript-sdk-android-arm64/package.json').version
|
|
80
|
-
if (bindingPackageVersion !== '1.0.
|
|
81
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.
|
|
80
|
+
if (bindingPackageVersion !== '1.0.56' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
81
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.56 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
82
82
|
}
|
|
83
83
|
return binding
|
|
84
84
|
} catch (e) {
|
|
@@ -93,8 +93,8 @@ function requireNative() {
|
|
|
93
93
|
try {
|
|
94
94
|
const binding = require('cas-typescript-sdk-android-arm-eabi')
|
|
95
95
|
const bindingPackageVersion = require('cas-typescript-sdk-android-arm-eabi/package.json').version
|
|
96
|
-
if (bindingPackageVersion !== '1.0.
|
|
97
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.
|
|
96
|
+
if (bindingPackageVersion !== '1.0.56' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
97
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.56 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
98
98
|
}
|
|
99
99
|
return binding
|
|
100
100
|
} catch (e) {
|
|
@@ -114,8 +114,8 @@ function requireNative() {
|
|
|
114
114
|
try {
|
|
115
115
|
const binding = require('cas-typescript-sdk-win32-x64-gnu')
|
|
116
116
|
const bindingPackageVersion = require('cas-typescript-sdk-win32-x64-gnu/package.json').version
|
|
117
|
-
if (bindingPackageVersion !== '1.0.
|
|
118
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.
|
|
117
|
+
if (bindingPackageVersion !== '1.0.56' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
118
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.56 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
119
119
|
}
|
|
120
120
|
return binding
|
|
121
121
|
} catch (e) {
|
|
@@ -130,8 +130,8 @@ function requireNative() {
|
|
|
130
130
|
try {
|
|
131
131
|
const binding = require('cas-typescript-sdk-win32-x64-msvc')
|
|
132
132
|
const bindingPackageVersion = require('cas-typescript-sdk-win32-x64-msvc/package.json').version
|
|
133
|
-
if (bindingPackageVersion !== '1.0.
|
|
134
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.
|
|
133
|
+
if (bindingPackageVersion !== '1.0.56' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
134
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.56 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
135
135
|
}
|
|
136
136
|
return binding
|
|
137
137
|
} catch (e) {
|
|
@@ -147,8 +147,8 @@ function requireNative() {
|
|
|
147
147
|
try {
|
|
148
148
|
const binding = require('cas-typescript-sdk-win32-ia32-msvc')
|
|
149
149
|
const bindingPackageVersion = require('cas-typescript-sdk-win32-ia32-msvc/package.json').version
|
|
150
|
-
if (bindingPackageVersion !== '1.0.
|
|
151
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.
|
|
150
|
+
if (bindingPackageVersion !== '1.0.56' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
151
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.56 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
152
152
|
}
|
|
153
153
|
return binding
|
|
154
154
|
} catch (e) {
|
|
@@ -163,8 +163,8 @@ function requireNative() {
|
|
|
163
163
|
try {
|
|
164
164
|
const binding = require('cas-typescript-sdk-win32-arm64-msvc')
|
|
165
165
|
const bindingPackageVersion = require('cas-typescript-sdk-win32-arm64-msvc/package.json').version
|
|
166
|
-
if (bindingPackageVersion !== '1.0.
|
|
167
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.
|
|
166
|
+
if (bindingPackageVersion !== '1.0.56' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
167
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.56 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
168
168
|
}
|
|
169
169
|
return binding
|
|
170
170
|
} catch (e) {
|
|
@@ -182,8 +182,8 @@ function requireNative() {
|
|
|
182
182
|
try {
|
|
183
183
|
const binding = require('cas-typescript-sdk-darwin-universal')
|
|
184
184
|
const bindingPackageVersion = require('cas-typescript-sdk-darwin-universal/package.json').version
|
|
185
|
-
if (bindingPackageVersion !== '1.0.
|
|
186
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.
|
|
185
|
+
if (bindingPackageVersion !== '1.0.56' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
186
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.56 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
187
187
|
}
|
|
188
188
|
return binding
|
|
189
189
|
} catch (e) {
|
|
@@ -198,8 +198,8 @@ function requireNative() {
|
|
|
198
198
|
try {
|
|
199
199
|
const binding = require('cas-typescript-sdk-darwin-x64')
|
|
200
200
|
const bindingPackageVersion = require('cas-typescript-sdk-darwin-x64/package.json').version
|
|
201
|
-
if (bindingPackageVersion !== '1.0.
|
|
202
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.
|
|
201
|
+
if (bindingPackageVersion !== '1.0.56' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
202
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.56 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
203
203
|
}
|
|
204
204
|
return binding
|
|
205
205
|
} catch (e) {
|
|
@@ -214,8 +214,8 @@ function requireNative() {
|
|
|
214
214
|
try {
|
|
215
215
|
const binding = require('cas-typescript-sdk-darwin-arm64')
|
|
216
216
|
const bindingPackageVersion = require('cas-typescript-sdk-darwin-arm64/package.json').version
|
|
217
|
-
if (bindingPackageVersion !== '1.0.
|
|
218
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.
|
|
217
|
+
if (bindingPackageVersion !== '1.0.56' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
218
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.56 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
219
219
|
}
|
|
220
220
|
return binding
|
|
221
221
|
} catch (e) {
|
|
@@ -234,8 +234,8 @@ function requireNative() {
|
|
|
234
234
|
try {
|
|
235
235
|
const binding = require('cas-typescript-sdk-freebsd-x64')
|
|
236
236
|
const bindingPackageVersion = require('cas-typescript-sdk-freebsd-x64/package.json').version
|
|
237
|
-
if (bindingPackageVersion !== '1.0.
|
|
238
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.
|
|
237
|
+
if (bindingPackageVersion !== '1.0.56' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
238
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.56 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
239
239
|
}
|
|
240
240
|
return binding
|
|
241
241
|
} catch (e) {
|
|
@@ -250,8 +250,8 @@ function requireNative() {
|
|
|
250
250
|
try {
|
|
251
251
|
const binding = require('cas-typescript-sdk-freebsd-arm64')
|
|
252
252
|
const bindingPackageVersion = require('cas-typescript-sdk-freebsd-arm64/package.json').version
|
|
253
|
-
if (bindingPackageVersion !== '1.0.
|
|
254
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.
|
|
253
|
+
if (bindingPackageVersion !== '1.0.56' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
254
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.56 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
255
255
|
}
|
|
256
256
|
return binding
|
|
257
257
|
} catch (e) {
|
|
@@ -271,8 +271,8 @@ function requireNative() {
|
|
|
271
271
|
try {
|
|
272
272
|
const binding = require('cas-typescript-sdk-linux-x64-musl')
|
|
273
273
|
const bindingPackageVersion = require('cas-typescript-sdk-linux-x64-musl/package.json').version
|
|
274
|
-
if (bindingPackageVersion !== '1.0.
|
|
275
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.
|
|
274
|
+
if (bindingPackageVersion !== '1.0.56' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
275
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.56 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
276
276
|
}
|
|
277
277
|
return binding
|
|
278
278
|
} catch (e) {
|
|
@@ -287,8 +287,8 @@ function requireNative() {
|
|
|
287
287
|
try {
|
|
288
288
|
const binding = require('cas-typescript-sdk-linux-x64-gnu')
|
|
289
289
|
const bindingPackageVersion = require('cas-typescript-sdk-linux-x64-gnu/package.json').version
|
|
290
|
-
if (bindingPackageVersion !== '1.0.
|
|
291
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.
|
|
290
|
+
if (bindingPackageVersion !== '1.0.56' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
291
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.56 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
292
292
|
}
|
|
293
293
|
return binding
|
|
294
294
|
} catch (e) {
|
|
@@ -305,8 +305,8 @@ function requireNative() {
|
|
|
305
305
|
try {
|
|
306
306
|
const binding = require('cas-typescript-sdk-linux-arm64-musl')
|
|
307
307
|
const bindingPackageVersion = require('cas-typescript-sdk-linux-arm64-musl/package.json').version
|
|
308
|
-
if (bindingPackageVersion !== '1.0.
|
|
309
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.
|
|
308
|
+
if (bindingPackageVersion !== '1.0.56' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
309
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.56 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
310
310
|
}
|
|
311
311
|
return binding
|
|
312
312
|
} catch (e) {
|
|
@@ -321,8 +321,8 @@ function requireNative() {
|
|
|
321
321
|
try {
|
|
322
322
|
const binding = require('cas-typescript-sdk-linux-arm64-gnu')
|
|
323
323
|
const bindingPackageVersion = require('cas-typescript-sdk-linux-arm64-gnu/package.json').version
|
|
324
|
-
if (bindingPackageVersion !== '1.0.
|
|
325
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.
|
|
324
|
+
if (bindingPackageVersion !== '1.0.56' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
325
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.56 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
326
326
|
}
|
|
327
327
|
return binding
|
|
328
328
|
} catch (e) {
|
|
@@ -339,8 +339,8 @@ function requireNative() {
|
|
|
339
339
|
try {
|
|
340
340
|
const binding = require('cas-typescript-sdk-linux-arm-musleabihf')
|
|
341
341
|
const bindingPackageVersion = require('cas-typescript-sdk-linux-arm-musleabihf/package.json').version
|
|
342
|
-
if (bindingPackageVersion !== '1.0.
|
|
343
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.
|
|
342
|
+
if (bindingPackageVersion !== '1.0.56' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
343
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.56 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
344
344
|
}
|
|
345
345
|
return binding
|
|
346
346
|
} catch (e) {
|
|
@@ -355,8 +355,8 @@ function requireNative() {
|
|
|
355
355
|
try {
|
|
356
356
|
const binding = require('cas-typescript-sdk-linux-arm-gnueabihf')
|
|
357
357
|
const bindingPackageVersion = require('cas-typescript-sdk-linux-arm-gnueabihf/package.json').version
|
|
358
|
-
if (bindingPackageVersion !== '1.0.
|
|
359
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.
|
|
358
|
+
if (bindingPackageVersion !== '1.0.56' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
359
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.56 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
360
360
|
}
|
|
361
361
|
return binding
|
|
362
362
|
} catch (e) {
|
|
@@ -373,8 +373,8 @@ function requireNative() {
|
|
|
373
373
|
try {
|
|
374
374
|
const binding = require('cas-typescript-sdk-linux-loong64-musl')
|
|
375
375
|
const bindingPackageVersion = require('cas-typescript-sdk-linux-loong64-musl/package.json').version
|
|
376
|
-
if (bindingPackageVersion !== '1.0.
|
|
377
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.
|
|
376
|
+
if (bindingPackageVersion !== '1.0.56' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
377
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.56 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
378
378
|
}
|
|
379
379
|
return binding
|
|
380
380
|
} catch (e) {
|
|
@@ -389,8 +389,8 @@ function requireNative() {
|
|
|
389
389
|
try {
|
|
390
390
|
const binding = require('cas-typescript-sdk-linux-loong64-gnu')
|
|
391
391
|
const bindingPackageVersion = require('cas-typescript-sdk-linux-loong64-gnu/package.json').version
|
|
392
|
-
if (bindingPackageVersion !== '1.0.
|
|
393
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.
|
|
392
|
+
if (bindingPackageVersion !== '1.0.56' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
393
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.56 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
394
394
|
}
|
|
395
395
|
return binding
|
|
396
396
|
} catch (e) {
|
|
@@ -407,8 +407,8 @@ function requireNative() {
|
|
|
407
407
|
try {
|
|
408
408
|
const binding = require('cas-typescript-sdk-linux-riscv64-musl')
|
|
409
409
|
const bindingPackageVersion = require('cas-typescript-sdk-linux-riscv64-musl/package.json').version
|
|
410
|
-
if (bindingPackageVersion !== '1.0.
|
|
411
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.
|
|
410
|
+
if (bindingPackageVersion !== '1.0.56' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
411
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.56 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
412
412
|
}
|
|
413
413
|
return binding
|
|
414
414
|
} catch (e) {
|
|
@@ -423,8 +423,8 @@ function requireNative() {
|
|
|
423
423
|
try {
|
|
424
424
|
const binding = require('cas-typescript-sdk-linux-riscv64-gnu')
|
|
425
425
|
const bindingPackageVersion = require('cas-typescript-sdk-linux-riscv64-gnu/package.json').version
|
|
426
|
-
if (bindingPackageVersion !== '1.0.
|
|
427
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.
|
|
426
|
+
if (bindingPackageVersion !== '1.0.56' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
427
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.56 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
428
428
|
}
|
|
429
429
|
return binding
|
|
430
430
|
} catch (e) {
|
|
@@ -440,8 +440,8 @@ function requireNative() {
|
|
|
440
440
|
try {
|
|
441
441
|
const binding = require('cas-typescript-sdk-linux-ppc64-gnu')
|
|
442
442
|
const bindingPackageVersion = require('cas-typescript-sdk-linux-ppc64-gnu/package.json').version
|
|
443
|
-
if (bindingPackageVersion !== '1.0.
|
|
444
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.
|
|
443
|
+
if (bindingPackageVersion !== '1.0.56' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
444
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.56 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
445
445
|
}
|
|
446
446
|
return binding
|
|
447
447
|
} catch (e) {
|
|
@@ -456,8 +456,8 @@ function requireNative() {
|
|
|
456
456
|
try {
|
|
457
457
|
const binding = require('cas-typescript-sdk-linux-s390x-gnu')
|
|
458
458
|
const bindingPackageVersion = require('cas-typescript-sdk-linux-s390x-gnu/package.json').version
|
|
459
|
-
if (bindingPackageVersion !== '1.0.
|
|
460
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.
|
|
459
|
+
if (bindingPackageVersion !== '1.0.56' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
460
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.56 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
461
461
|
}
|
|
462
462
|
return binding
|
|
463
463
|
} catch (e) {
|
|
@@ -476,8 +476,8 @@ function requireNative() {
|
|
|
476
476
|
try {
|
|
477
477
|
const binding = require('cas-typescript-sdk-openharmony-arm64')
|
|
478
478
|
const bindingPackageVersion = require('cas-typescript-sdk-openharmony-arm64/package.json').version
|
|
479
|
-
if (bindingPackageVersion !== '1.0.
|
|
480
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.
|
|
479
|
+
if (bindingPackageVersion !== '1.0.56' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
480
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.56 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
481
481
|
}
|
|
482
482
|
return binding
|
|
483
483
|
} catch (e) {
|
|
@@ -492,8 +492,8 @@ function requireNative() {
|
|
|
492
492
|
try {
|
|
493
493
|
const binding = require('cas-typescript-sdk-openharmony-x64')
|
|
494
494
|
const bindingPackageVersion = require('cas-typescript-sdk-openharmony-x64/package.json').version
|
|
495
|
-
if (bindingPackageVersion !== '1.0.
|
|
496
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.
|
|
495
|
+
if (bindingPackageVersion !== '1.0.56' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
496
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.56 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
497
497
|
}
|
|
498
498
|
return binding
|
|
499
499
|
} catch (e) {
|
|
@@ -508,8 +508,8 @@ function requireNative() {
|
|
|
508
508
|
try {
|
|
509
509
|
const binding = require('cas-typescript-sdk-openharmony-arm')
|
|
510
510
|
const bindingPackageVersion = require('cas-typescript-sdk-openharmony-arm/package.json').version
|
|
511
|
-
if (bindingPackageVersion !== '1.0.
|
|
512
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.
|
|
511
|
+
if (bindingPackageVersion !== '1.0.56' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
512
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.56 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
513
513
|
}
|
|
514
514
|
return binding
|
|
515
515
|
} catch (e) {
|
|
@@ -618,6 +618,9 @@ module.exports.hpkeGenerateKeypair = nativeBinding.hpkeGenerateKeypair
|
|
|
618
618
|
module.exports.scryptHash = nativeBinding.scryptHash
|
|
619
619
|
module.exports.scryptHashParams = nativeBinding.scryptHashParams
|
|
620
620
|
module.exports.scryptVerify = nativeBinding.scryptVerify
|
|
621
|
+
module.exports.sendBenchmarkToApi = nativeBinding.sendBenchmarkToApi
|
|
622
|
+
module.exports.setApiKey = nativeBinding.setApiKey
|
|
623
|
+
module.exports.setBaseUrl = nativeBinding.setBaseUrl
|
|
621
624
|
module.exports.sha256 = nativeBinding.sha256
|
|
622
625
|
module.exports.sha256RsaDigitalSignature = nativeBinding.sha256RsaDigitalSignature
|
|
623
626
|
module.exports.sha256RsaVerifyDigitalSignature = nativeBinding.sha256RsaVerifyDigitalSignature
|
package/index.linux-x64-gnu.node
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RSAWrapper.d.ts","sourceRoot":"","sources":["../../src-ts/asymmetric/RSAWrapper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RSAWrapper.d.ts","sourceRoot":"","sources":["../../src-ts/asymmetric/RSAWrapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAuC,MAAM,aAAa,CAAC;AAGvF,qBAAa,UAAU;IAErB;;;;OAIG;IAEI,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,mBAAmB;IAOzD;;;;;OAKG;IAEH;;;;;OAKG;IAEI,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC;IAUzE;;;;;;OAMG;IAEI,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,OAAO;CAYzF"}
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.RSAWrapper = void 0;
|
|
10
|
+
const index_1 = require("../../index");
|
|
11
|
+
const benchmark_method_1 = require("../decorators/benchmark-method");
|
|
12
|
+
class RSAWrapper {
|
|
3
13
|
/**
|
|
4
14
|
* Generates an RSA key pair based of parameter sent in 1024, 2048, and 4096 are supported.
|
|
5
15
|
* @param keySize
|
|
@@ -9,7 +19,7 @@ export class RSAWrapper {
|
|
|
9
19
|
if (keySize !== 1024 && keySize !== 2048 && keySize !== 4096) {
|
|
10
20
|
throw new Error("You must provide an appropriate key size to generate RSA keys");
|
|
11
21
|
}
|
|
12
|
-
return generateRsaKeys(keySize);
|
|
22
|
+
return (0, index_1.generateRsaKeys)(keySize);
|
|
13
23
|
}
|
|
14
24
|
/**
|
|
15
25
|
* Encrypts a plaintext byte array with a RSA public key
|
|
@@ -30,7 +40,7 @@ export class RSAWrapper {
|
|
|
30
40
|
if (!dataToSign || dataToSign.length === 0) {
|
|
31
41
|
throw new Error("You must provide an allocated hash to sign with RSA");
|
|
32
42
|
}
|
|
33
|
-
return signRsa(privateKey, dataToSign);
|
|
43
|
+
return (0, index_1.signRsa)(privateKey, dataToSign);
|
|
34
44
|
}
|
|
35
45
|
/**
|
|
36
46
|
* Verifies signed data by the corresponding private key with an RSA public key.
|
|
@@ -49,7 +59,17 @@ export class RSAWrapper {
|
|
|
49
59
|
if (!signature || signature.length === 0) {
|
|
50
60
|
throw new Error("You must provide and allocated signature to verify with RSA");
|
|
51
61
|
}
|
|
52
|
-
return verifyRsa(publicKey, hash, signature);
|
|
62
|
+
return (0, index_1.verifyRsa)(publicKey, hash, signature);
|
|
53
63
|
}
|
|
54
64
|
}
|
|
65
|
+
exports.RSAWrapper = RSAWrapper;
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, benchmark_method_1.benchmarkMethod)()
|
|
68
|
+
], RSAWrapper.prototype, "generateKeys", null);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, benchmark_method_1.benchmarkMethod)()
|
|
71
|
+
], RSAWrapper.prototype, "sign", null);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, benchmark_method_1.benchmarkMethod)()
|
|
74
|
+
], RSAWrapper.prototype, "verify", null);
|
|
55
75
|
//# sourceMappingURL=RSAWrapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RSAWrapper.js","sourceRoot":"","sources":["../../src-ts/asymmetric/RSAWrapper.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"RSAWrapper.js","sourceRoot":"","sources":["../../src-ts/asymmetric/RSAWrapper.ts"],"names":[],"mappings":";;;;;;;;;AAAA,uCAAuF;AACvF,qEAAiE;AAEjE,MAAa,UAAU;IAErB;;;;OAIG;IAEI,YAAY,CAAC,OAAe;QACjC,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;YAC3D,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;QACrF,CAAC;QACD,OAAO,IAAA,uBAAe,EAAC,OAAO,CAAC,CAAC;IAClC,CAAC;IAED;;;;;OAKG;IAEH;;;;;OAKG;IAEI,IAAI,CAAC,UAAkB,EAAE,UAAyB;QACvD,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;QACrE,CAAC;QACD,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC3C,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;QACzE,CAAC;QACD,OAAO,IAAA,eAAO,EAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IACzC,CAAC;IAED;;;;;;OAMG;IAEI,MAAM,CAAC,SAAiB,EAAE,IAAmB,EAAE,SAAwB;QAC5E,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;QACtE,CAAC;QACD,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC/B,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;QAC3E,CAAC;QACD,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzC,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAC;QACjF,CAAC;QACD,OAAO,IAAA,iBAAS,EAAC,SAAS,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;IAC/C,CAAC;CACF;AA3DD,gCA2DC;AAnDQ;IADN,IAAA,kCAAe,GAAE;8CAMjB;AAgBM;IADN,IAAA,kCAAe,GAAE;sCASjB;AAUM;IADN,IAAA,kCAAe,GAAE;wCAYjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src-ts/asymmetric/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src-ts/asymmetric/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,CAAC"}
|
package/lib/asymmetric/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RSAWrapper = void 0;
|
|
4
|
+
const RSAWrapper_1 = require("./RSAWrapper");
|
|
5
|
+
Object.defineProperty(exports, "RSAWrapper", { enumerable: true, get: function () { return RSAWrapper_1.RSAWrapper; } });
|
|
3
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src-ts/asymmetric/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src-ts/asymmetric/index.ts"],"names":[],"mappings":";;;AAAA,6CAA0C;AAGjC,2FAHA,uBAAU,OAGA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare class CASConfiguration {
|
|
2
|
+
/**
|
|
3
|
+
* Indicates whether the SDK is running in development mode. If true, the SDK will use the local development server URL.
|
|
4
|
+
* Default is false. We do not recommend setting this to true in production environments.
|
|
5
|
+
*/
|
|
6
|
+
isDevelopment: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Indicates whether the SDK is running in staging mode. If true, the SDK will use the staging server URL.
|
|
9
|
+
* Default is false. We do not recommend setting this to true in production environments.
|
|
10
|
+
*/
|
|
11
|
+
isStaging: boolean;
|
|
12
|
+
private _apiKey;
|
|
13
|
+
private _url;
|
|
14
|
+
get url(): string;
|
|
15
|
+
set apiKey(value: string);
|
|
16
|
+
get apiKey(): string | null;
|
|
17
|
+
}
|
|
18
|
+
declare const _default: CASConfiguration;
|
|
19
|
+
export default _default;
|
|
20
|
+
//# sourceMappingURL=cas-configuration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cas-configuration.d.ts","sourceRoot":"","sources":["../src-ts/cas-configuration.ts"],"names":[],"mappings":"AAEA,cAAM,gBAAgB;IAClB;;;OAGG;IACI,aAAa,EAAE,OAAO,CAAS;IACtC;;;OAGG;IACI,SAAS,EAAE,OAAO,CAAS;IAElC,OAAO,CAAC,OAAO,CAAuB;IACtC,OAAO,CAAC,IAAI,CAAkD;IAG9D,IAAW,GAAG,IAAI,MAAM,CAWvB;IAED,IAAW,MAAM,CAAC,KAAK,EAAE,MAAM,EAO9B;IAED,IAAW,MAAM,IAAI,MAAM,GAAG,IAAI,CAEjC;CACJ;;AAED,wBAAsC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const http_wrapper_1 = require("./http/http-wrapper");
|
|
4
|
+
class CASConfiguration {
|
|
5
|
+
constructor() {
|
|
6
|
+
/**
|
|
7
|
+
* Indicates whether the SDK is running in development mode. If true, the SDK will use the local development server URL.
|
|
8
|
+
* Default is false. We do not recommend setting this to true in production environments.
|
|
9
|
+
*/
|
|
10
|
+
this.isDevelopment = false;
|
|
11
|
+
/**
|
|
12
|
+
* Indicates whether the SDK is running in staging mode. If true, the SDK will use the staging server URL.
|
|
13
|
+
* Default is false. We do not recommend setting this to true in production environments.
|
|
14
|
+
*/
|
|
15
|
+
this.isStaging = false;
|
|
16
|
+
this._apiKey = null;
|
|
17
|
+
this._url = "https://cryptographicapiservices.com";
|
|
18
|
+
}
|
|
19
|
+
get url() {
|
|
20
|
+
if (this.isDevelopment && this.isStaging) {
|
|
21
|
+
throw new Error("Both isDevelopment and isStaging cannot be true at the same time.");
|
|
22
|
+
}
|
|
23
|
+
if (this.isDevelopment) {
|
|
24
|
+
this._url = "http://localhost:5000";
|
|
25
|
+
}
|
|
26
|
+
else if (this.isStaging) {
|
|
27
|
+
this._url = "https://staging.cryptographicapiservices.com";
|
|
28
|
+
}
|
|
29
|
+
return this._url;
|
|
30
|
+
}
|
|
31
|
+
set apiKey(value) {
|
|
32
|
+
if (!value) {
|
|
33
|
+
throw new Error("API key must be a allocated string.");
|
|
34
|
+
}
|
|
35
|
+
http_wrapper_1.HttpWrapper.setBaseUrl(this.url);
|
|
36
|
+
http_wrapper_1.HttpWrapper.setApiKey(value);
|
|
37
|
+
this._apiKey = value;
|
|
38
|
+
}
|
|
39
|
+
get apiKey() {
|
|
40
|
+
return this._apiKey;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.default = new CASConfiguration();
|
|
44
|
+
//# sourceMappingURL=cas-configuration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cas-configuration.js","sourceRoot":"","sources":["../src-ts/cas-configuration.ts"],"names":[],"mappings":";;AAAA,sDAAkD;AAElD,MAAM,gBAAgB;IAAtB;QACI;;;WAGG;QACI,kBAAa,GAAY,KAAK,CAAC;QACtC;;;WAGG;QACI,cAAS,GAAY,KAAK,CAAC;QAE1B,YAAO,GAAkB,IAAI,CAAC;QAC9B,SAAI,GAAW,sCAAsC,CAAC;IA4BlE,CAAC;IAzBG,IAAW,GAAG;QACV,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACvC,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAC;QACzF,CAAC;QAED,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YACrB,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;QACxC,CAAC;aAAM,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACxB,IAAI,CAAC,IAAI,GAAG,8CAA8C,CAAC;QAC/D,CAAC;QACD,OAAO,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;IAED,IAAW,MAAM,CAAC,KAAa;QAC3B,IAAI,CAAC,KAAK,EAAE,CAAC;YACT,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;QAC3D,CAAC;QACD,0BAAW,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACjC,0BAAW,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACzB,CAAC;IAED,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;CACJ;AAED,kBAAe,IAAI,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"benchmark-method.d.ts","sourceRoot":"","sources":["../../src-ts/decorators/benchmark-method.ts"],"names":[],"mappings":"AAGA,wBAAgB,eAAe,IAAI,eAAe,CAgCjD"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.benchmarkMethod = benchmarkMethod;
|
|
4
|
+
const __1 = require("..");
|
|
5
|
+
const http_wrapper_1 = require("../http/http-wrapper");
|
|
6
|
+
function benchmarkMethod() {
|
|
7
|
+
return function (target, propertyKey, descriptor) {
|
|
8
|
+
if (!descriptor)
|
|
9
|
+
return;
|
|
10
|
+
const originalMethod = descriptor.value;
|
|
11
|
+
descriptor.value = function (...args) {
|
|
12
|
+
if (!canSendBenchmark()) {
|
|
13
|
+
return originalMethod.apply(this, args);
|
|
14
|
+
}
|
|
15
|
+
const className = this.constructor.name;
|
|
16
|
+
const startTime = performance.now();
|
|
17
|
+
const result = originalMethod.apply(this, args);
|
|
18
|
+
const endTime = performance.now();
|
|
19
|
+
const timespan = Math.round(endTime - startTime);
|
|
20
|
+
http_wrapper_1.HttpWrapper.sendBenchmark(timespan, className, propertyKey.toString());
|
|
21
|
+
return result;
|
|
22
|
+
};
|
|
23
|
+
return descriptor;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
const canSendBenchmark = () => {
|
|
27
|
+
return !!__1.CASConfiguration.apiKey;
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=benchmark-method.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"benchmark-method.js","sourceRoot":"","sources":["../../src-ts/decorators/benchmark-method.ts"],"names":[],"mappings":";;AAGA,0CAgCC;AAnCD,0BAAsC;AACtC,uDAAmD;AAEnD,SAAgB,eAAe;IAC7B,OAAO,UACL,MAAW,EACX,WAA4B,EAC5B,UAA8B;QAG9B,IAAI,CAAC,UAAU;YAAE,OAAO;QAExB,MAAM,cAAc,GAAG,UAAU,CAAC,KAAK,CAAC;QAExC,UAAU,CAAC,KAAK,GAAG,UAAU,GAAG,IAAW;YAEzC,IAAI,CAAC,gBAAgB,EAAE,EAAE,CAAC;gBACxB,OAAO,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAC1C,CAAC;YAED,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;YACxC,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;YAEpC,MAAM,MAAM,GAAG,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAEhD,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;YAClC,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;YAEjD,0BAAW,CAAC,aAAa,CAAC,QAAQ,EAAE,SAAS,EAAE,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC;YAEvE,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC;QAEF,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,gBAAgB,GAAG,GAAG,EAAE;IAC5B,OAAO,CAAC,CAAC,oBAAgB,CAAC,MAAM,CAAC;AACnC,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CASRSADigitalSignatureResult } from "
|
|
2
|
-
import { IDigitalSignature } from "./digital-signature-base
|
|
1
|
+
import { CASRSADigitalSignatureResult } from "../../index";
|
|
2
|
+
import { IDigitalSignature } from "./digital-signature-base";
|
|
3
3
|
export declare class DigitalSignatureSHA512Wrapper implements IDigitalSignature {
|
|
4
4
|
/**
|
|
5
5
|
* Generates and RSA digital signature with SHA3-512
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"digital-siganture-sha-512.d.ts","sourceRoot":"","sources":["../../src-ts/digital-signature/digital-siganture-sha-512.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"digital-siganture-sha-512.d.ts","sourceRoot":"","sources":["../../src-ts/digital-signature/digital-siganture-sha-512.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAwG,MAAM,aAAa,CAAC;AAEjK,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,qBAAa,6BAA8B,YAAW,iBAAiB;IACnE;;;;;OAKG;IAEH,SAAS,CAAC,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,4BAA4B;IAUrF;;;;;;OAMG;IACH,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO;CAYxF"}
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.DigitalSignatureSHA512Wrapper = void 0;
|
|
10
|
+
const index_1 = require("../../index");
|
|
11
|
+
const benchmark_method_1 = require("../decorators/benchmark-method");
|
|
12
|
+
class DigitalSignatureSHA512Wrapper {
|
|
3
13
|
/**
|
|
4
14
|
* Generates and RSA digital signature with SHA3-512
|
|
5
15
|
* @param rsa_key_size
|
|
@@ -13,7 +23,7 @@ export class DigitalSignatureSHA512Wrapper {
|
|
|
13
23
|
if (data_to_sign?.length === 0) {
|
|
14
24
|
throw new Error("Must provide allocated data to sign");
|
|
15
25
|
}
|
|
16
|
-
return sha512RsaDigitalSignature(rsa_key_size, data_to_sign);
|
|
26
|
+
return (0, index_1.sha512RsaDigitalSignature)(rsa_key_size, data_to_sign);
|
|
17
27
|
}
|
|
18
28
|
/**
|
|
19
29
|
* Verifies a digital signature created with the RSA public key.
|
|
@@ -32,7 +42,11 @@ export class DigitalSignatureSHA512Wrapper {
|
|
|
32
42
|
if (signature?.length === 0) {
|
|
33
43
|
throw new Error("Must provide an allocated signature");
|
|
34
44
|
}
|
|
35
|
-
return sha512RsaVerifyDigitalSignature(public_key, data_to_verify, signature);
|
|
45
|
+
return (0, index_1.sha512RsaVerifyDigitalSignature)(public_key, data_to_verify, signature);
|
|
36
46
|
}
|
|
37
47
|
}
|
|
48
|
+
exports.DigitalSignatureSHA512Wrapper = DigitalSignatureSHA512Wrapper;
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, benchmark_method_1.benchmarkMethod)()
|
|
51
|
+
], DigitalSignatureSHA512Wrapper.prototype, "createRsa", null);
|
|
38
52
|
//# sourceMappingURL=digital-siganture-sha-512.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"digital-siganture-sha-512.js","sourceRoot":"","sources":["../../src-ts/digital-signature/digital-siganture-sha-512.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"digital-siganture-sha-512.js","sourceRoot":"","sources":["../../src-ts/digital-signature/digital-siganture-sha-512.ts"],"names":[],"mappings":";;;;;;;;;AAAA,uCAAiK;AACjK,qEAAiE;AAGjE,MAAa,6BAA6B;IACtC;;;;;OAKG;IAEH,SAAS,CAAC,YAAoB,EAAE,YAAsB;QAClD,IAAI,YAAY,KAAK,IAAI,IAAI,YAAY,KAAK,IAAI,IAAI,YAAY,KAAK,IAAI,EAAE,CAAC;YAC1E,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;QACxE,CAAC;QACD,IAAI,YAAY,EAAE,MAAM,KAAK,CAAC,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;QAC3D,CAAC;QACD,OAAO,IAAA,iCAAyB,EAAC,YAAY,EAAE,YAAY,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;OAMG;IACH,SAAS,CAAC,UAAkB,EAAE,cAAwB,EAAE,SAAmB;QACvE,IAAI,CAAC,UAAU,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;QACjD,CAAC;QACD,IAAI,cAAc,EAAE,MAAM,KAAK,CAAC,EAAE,CAAC;YAC/B,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;QAChE,CAAC;QACD,IAAI,SAAS,EAAE,MAAM,KAAK,CAAC,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;QAC3D,CAAC;QACD,OAAO,IAAA,uCAA+B,EAAC,UAAU,EAAE,cAAc,EAAE,SAAS,CAAC,CAAC;IAClF,CAAC;CACJ;AArCD,sEAqCC;AA7BG;IADC,IAAA,kCAAe,GAAE;8DASjB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CASRSADigitalSignatureResult } from "../../index
|
|
1
|
+
import { CASRSADigitalSignatureResult } from "../../index";
|
|
2
2
|
export interface IDigitalSignature {
|
|
3
3
|
createRsa(rsa_key_size: number, data_to_sign: Array<number>): CASRSADigitalSignatureResult;
|
|
4
4
|
verifyRSa(public_key: string, data_to_verify: Array<number>, signature: Array<number>): boolean;
|