cas-typescript-sdk 1.0.62 → 1.0.63
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 +0 -29
- package/index.darwin-x64.node +0 -0
- package/index.js +52 -63
- 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/index.d.ts +0 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +0 -1
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/lib/digital-signature/digital-siganture-sha-512.d.ts +0 -20
- package/lib/digital-signature/digital-siganture-sha-512.d.ts.map +0 -1
- package/lib/digital-signature/digital-siganture-sha-512.js +0 -42
- package/lib/digital-signature/digital-siganture-sha-512.js.map +0 -1
- package/lib/digital-signature/digital-signature-base.d.ts +0 -6
- package/lib/digital-signature/digital-signature-base.d.ts.map +0 -1
- package/lib/digital-signature/digital-signature-base.js +0 -3
- package/lib/digital-signature/digital-signature-base.js.map +0 -1
- package/lib/digital-signature/digital-signature-factory.d.ts +0 -14
- package/lib/digital-signature/digital-signature-factory.d.ts.map +0 -1
- package/lib/digital-signature/digital-signature-factory.js +0 -28
- package/lib/digital-signature/digital-signature-factory.js.map +0 -1
- package/lib/digital-signature/digital-signaturte-sha-256.d.ts +0 -20
- package/lib/digital-signature/digital-signaturte-sha-256.d.ts.map +0 -1
- package/lib/digital-signature/digital-signaturte-sha-256.js +0 -42
- package/lib/digital-signature/digital-signaturte-sha-256.js.map +0 -1
- package/lib/digital-signature/index.d.ts +0 -7
- package/lib/digital-signature/index.d.ts.map +0 -1
- package/lib/digital-signature/index.js +0 -12
- package/lib/digital-signature/index.js.map +0 -1
package/index.d.ts
CHANGED
|
@@ -7,14 +7,6 @@ export declare class Cased25519KeyPairResult {
|
|
|
7
7
|
}
|
|
8
8
|
export type CASED25519KeyPairResult = Cased25519KeyPairResult
|
|
9
9
|
|
|
10
|
-
export declare class CasrsaDigitalSignatureResult {
|
|
11
|
-
publicKey: string
|
|
12
|
-
privateKey: string
|
|
13
|
-
signature: Array<number>
|
|
14
|
-
constructor(publicKey: string, privateKey: string, signature: Array<number>)
|
|
15
|
-
}
|
|
16
|
-
export type CASRSADigitalSignatureResult = CasrsaDigitalSignatureResult
|
|
17
|
-
|
|
18
10
|
export declare class CasrsaKeyPairResult {
|
|
19
11
|
privateKey: string
|
|
20
12
|
publicKey: string
|
|
@@ -22,13 +14,6 @@ export declare class CasrsaKeyPairResult {
|
|
|
22
14
|
}
|
|
23
15
|
export type CASRSAKeyPairResult = CasrsaKeyPairResult
|
|
24
16
|
|
|
25
|
-
export declare class Casshaed25519DalekDigitalSignatureResult {
|
|
26
|
-
publicKey: Array<number>
|
|
27
|
-
signature: Array<number>
|
|
28
|
-
constructor(publicKey: Array<number>, signature: Array<number>)
|
|
29
|
-
}
|
|
30
|
-
export type CASSHAED25519DalekDigitalSignatureResult = Casshaed25519DalekDigitalSignatureResult
|
|
31
|
-
|
|
32
17
|
export declare class CaSx25519SecretPublicKeyResult {
|
|
33
18
|
publicKey: Array<number>
|
|
34
19
|
secretKey: Array<number>
|
|
@@ -118,26 +103,12 @@ export declare function scryptHashParams(password: string, cpuMemoryCost: number
|
|
|
118
103
|
|
|
119
104
|
export declare function scryptVerify(hashedPassword: string, passwordToVerify: string): boolean
|
|
120
105
|
|
|
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
|
-
|
|
127
106
|
export declare function sha256(dataToHash: Array<number>): Array<number>
|
|
128
107
|
|
|
129
|
-
export declare function sha256RsaDigitalSignature(rsaKeySize: number, dataToSign: Array<number>): CASRSADigitalSignatureResult
|
|
130
|
-
|
|
131
|
-
export declare function sha256RsaVerifyDigitalSignature(publicKey: string, dataToVerify: Array<number>, signature: Array<number>): boolean
|
|
132
|
-
|
|
133
108
|
export declare function sha256Verify(dataToHash: Array<number>, dataToVerify: Array<number>): boolean
|
|
134
109
|
|
|
135
110
|
export declare function sha512(dataToHash: Array<number>): Array<number>
|
|
136
111
|
|
|
137
|
-
export declare function sha512RsaDigitalSignature(rsaKeySize: number, dataToSign: Array<number>): CASRSADigitalSignatureResult
|
|
138
|
-
|
|
139
|
-
export declare function sha512RsaVerifyDigitalSignature(publicKey: string, dataToVerify: Array<number>, signature: Array<number>): boolean
|
|
140
|
-
|
|
141
112
|
export declare function sha512Verify(dataToHash: Array<number>, dataToVerify: Array<number>): boolean
|
|
142
113
|
|
|
143
114
|
export declare function signEd25519(privateKey: Array<number>, message: Array<number>): Array<number>
|
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.63' && 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.63 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.63' && 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.63 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.63' && 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.63 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.63' && 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.63 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.63' && 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.63 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.63' && 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.63 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.63' && 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.63 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.63' && 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.63 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.63' && 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.63 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.63' && 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.63 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.63' && 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.63 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.63' && 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.63 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.63' && 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.63 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.63' && 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.63 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.63' && 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.63 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.63' && 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.63 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.63' && 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.63 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.63' && 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.63 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.63' && 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.63 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.63' && 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.63 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.63' && 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.63 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.63' && 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.63 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.63' && 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.63 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.63' && 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.63 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.63' && 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.63 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.63' && 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.63 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
513
513
|
}
|
|
514
514
|
return binding
|
|
515
515
|
} catch (e) {
|
|
@@ -574,12 +574,8 @@ if (!nativeBinding) {
|
|
|
574
574
|
module.exports = nativeBinding
|
|
575
575
|
module.exports.Cased25519KeyPairResult = nativeBinding.Cased25519KeyPairResult
|
|
576
576
|
module.exports.CASED25519KeyPairResult = nativeBinding.CASED25519KeyPairResult
|
|
577
|
-
module.exports.CasrsaDigitalSignatureResult = nativeBinding.CasrsaDigitalSignatureResult
|
|
578
|
-
module.exports.CASRSADigitalSignatureResult = nativeBinding.CASRSADigitalSignatureResult
|
|
579
577
|
module.exports.CasrsaKeyPairResult = nativeBinding.CasrsaKeyPairResult
|
|
580
578
|
module.exports.CASRSAKeyPairResult = nativeBinding.CASRSAKeyPairResult
|
|
581
|
-
module.exports.Casshaed25519DalekDigitalSignatureResult = nativeBinding.Casshaed25519DalekDigitalSignatureResult
|
|
582
|
-
module.exports.CASSHAED25519DalekDigitalSignatureResult = nativeBinding.CASSHAED25519DalekDigitalSignatureResult
|
|
583
579
|
module.exports.CaSx25519SecretPublicKeyResult = nativeBinding.CaSx25519SecretPublicKeyResult
|
|
584
580
|
module.exports.CASx25519SecretPublicKeyResult = nativeBinding.CASx25519SecretPublicKeyResult
|
|
585
581
|
module.exports.HpkeEncryptResult = nativeBinding.HpkeEncryptResult
|
|
@@ -618,16 +614,9 @@ module.exports.hpkeGenerateKeypair = nativeBinding.hpkeGenerateKeypair
|
|
|
618
614
|
module.exports.scryptHash = nativeBinding.scryptHash
|
|
619
615
|
module.exports.scryptHashParams = nativeBinding.scryptHashParams
|
|
620
616
|
module.exports.scryptVerify = nativeBinding.scryptVerify
|
|
621
|
-
module.exports.sendBenchmarkToApi = nativeBinding.sendBenchmarkToApi
|
|
622
|
-
module.exports.setApiKey = nativeBinding.setApiKey
|
|
623
|
-
module.exports.setBaseUrl = nativeBinding.setBaseUrl
|
|
624
617
|
module.exports.sha256 = nativeBinding.sha256
|
|
625
|
-
module.exports.sha256RsaDigitalSignature = nativeBinding.sha256RsaDigitalSignature
|
|
626
|
-
module.exports.sha256RsaVerifyDigitalSignature = nativeBinding.sha256RsaVerifyDigitalSignature
|
|
627
618
|
module.exports.sha256Verify = nativeBinding.sha256Verify
|
|
628
619
|
module.exports.sha512 = nativeBinding.sha512
|
|
629
|
-
module.exports.sha512RsaDigitalSignature = nativeBinding.sha512RsaDigitalSignature
|
|
630
|
-
module.exports.sha512RsaVerifyDigitalSignature = nativeBinding.sha512RsaVerifyDigitalSignature
|
|
631
620
|
module.exports.sha512Verify = nativeBinding.sha512Verify
|
|
632
621
|
module.exports.signEd25519 = nativeBinding.signEd25519
|
|
633
622
|
module.exports.signRsa = nativeBinding.signRsa
|
package/index.linux-x64-gnu.node
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/index.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ export * from "./hashers/index";
|
|
|
3
3
|
export * from "./key_exchange/index";
|
|
4
4
|
export * from "./symmetric/index";
|
|
5
5
|
export * from "./asymmetric/index";
|
|
6
|
-
export * from "./digital-signature/index";
|
|
7
6
|
export * from "./sponges/index";
|
|
8
7
|
export * from "./message/index";
|
|
9
8
|
export * from "./signature/index";
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src-ts/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src-ts/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -19,7 +19,6 @@ __exportStar(require("./hashers/index"), exports);
|
|
|
19
19
|
__exportStar(require("./key_exchange/index"), exports);
|
|
20
20
|
__exportStar(require("./symmetric/index"), exports);
|
|
21
21
|
__exportStar(require("./asymmetric/index"), exports);
|
|
22
|
-
__exportStar(require("./digital-signature/index"), exports);
|
|
23
22
|
__exportStar(require("./sponges/index"), exports);
|
|
24
23
|
__exportStar(require("./message/index"), exports);
|
|
25
24
|
__exportStar(require("./signature/index"), exports);
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src-ts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AACzC,kDAAgC;AAChC,uDAAqC;AACrC,oDAAkC;AAClC,qDAAmC;AACnC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src-ts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AACzC,kDAAgC;AAChC,uDAAqC;AACrC,oDAAkC;AAClC,qDAAmC;AACnC,kDAAgC;AAChC,kDAAgC;AAChC,oDAAkC;AAClC,iDAA+B;AAC/B,sDAAoC"}
|
package/package.json
CHANGED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { CASRSADigitalSignatureResult } from "../../index";
|
|
2
|
-
import { IDigitalSignature } from "./digital-signature-base";
|
|
3
|
-
export declare class DigitalSignatureSHA512Wrapper implements IDigitalSignature {
|
|
4
|
-
/**
|
|
5
|
-
* Generates and RSA digital signature with SHA3-512
|
|
6
|
-
* @param rsa_key_size
|
|
7
|
-
* @param data_to_sign
|
|
8
|
-
* @returns CASRSADigitalSignatureResult
|
|
9
|
-
*/
|
|
10
|
-
createRsa(rsa_key_size: number, data_to_sign: number[]): CASRSADigitalSignatureResult;
|
|
11
|
-
/**
|
|
12
|
-
* Verifies a digital signature created with the RSA public key.
|
|
13
|
-
* @param public_key
|
|
14
|
-
* @param data_to_verify
|
|
15
|
-
* @param signature
|
|
16
|
-
* @returns boolean
|
|
17
|
-
*/
|
|
18
|
-
verifyRSa(public_key: string, data_to_verify: number[], signature: number[]): boolean;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=digital-siganture-sha-512.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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;IAEH,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO;CAYxF"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DigitalSignatureSHA512Wrapper = void 0;
|
|
4
|
-
const index_1 = require("../../index");
|
|
5
|
-
class DigitalSignatureSHA512Wrapper {
|
|
6
|
-
/**
|
|
7
|
-
* Generates and RSA digital signature with SHA3-512
|
|
8
|
-
* @param rsa_key_size
|
|
9
|
-
* @param data_to_sign
|
|
10
|
-
* @returns CASRSADigitalSignatureResult
|
|
11
|
-
*/
|
|
12
|
-
createRsa(rsa_key_size, data_to_sign) {
|
|
13
|
-
if (rsa_key_size !== 1024 && rsa_key_size !== 2048 && rsa_key_size !== 4096) {
|
|
14
|
-
throw new Error("You need to provide an appropriate RSA key size.");
|
|
15
|
-
}
|
|
16
|
-
if (data_to_sign?.length === 0) {
|
|
17
|
-
throw new Error("Must provide allocated data to sign");
|
|
18
|
-
}
|
|
19
|
-
return (0, index_1.sha512RsaDigitalSignature)(rsa_key_size, data_to_sign);
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Verifies a digital signature created with the RSA public key.
|
|
23
|
-
* @param public_key
|
|
24
|
-
* @param data_to_verify
|
|
25
|
-
* @param signature
|
|
26
|
-
* @returns boolean
|
|
27
|
-
*/
|
|
28
|
-
verifyRSa(public_key, data_to_verify, signature) {
|
|
29
|
-
if (!public_key) {
|
|
30
|
-
throw new Error("Must provide a public key");
|
|
31
|
-
}
|
|
32
|
-
if (data_to_verify?.length === 0) {
|
|
33
|
-
throw new Error("Must provide an allocated data to verify");
|
|
34
|
-
}
|
|
35
|
-
if (signature?.length === 0) {
|
|
36
|
-
throw new Error("Must provide an allocated signature");
|
|
37
|
-
}
|
|
38
|
-
return (0, index_1.sha512RsaVerifyDigitalSignature)(public_key, data_to_verify, signature);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
exports.DigitalSignatureSHA512Wrapper = DigitalSignatureSHA512Wrapper;
|
|
42
|
-
//# sourceMappingURL=digital-siganture-sha-512.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"digital-siganture-sha-512.js","sourceRoot":"","sources":["../../src-ts/digital-signature/digital-siganture-sha-512.ts"],"names":[],"mappings":";;;AAAA,uCAAiK;AAIjK,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;IAEH,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;AAtCD,sEAsCC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { CASRSADigitalSignatureResult } from "../../index";
|
|
2
|
-
export interface IDigitalSignature {
|
|
3
|
-
createRsa(rsa_key_size: number, data_to_sign: Array<number>): CASRSADigitalSignatureResult;
|
|
4
|
-
verifyRSa(public_key: string, data_to_verify: Array<number>, signature: Array<number>): boolean;
|
|
5
|
-
}
|
|
6
|
-
//# sourceMappingURL=digital-signature-base.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"digital-signature-base.d.ts","sourceRoot":"","sources":["../../src-ts/digital-signature/digital-signature-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAA4C,MAAM,aAAa,CAAC;AAErG,MAAM,WAAW,iBAAiB;IAC9B,SAAS,CAAC,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,4BAA4B,CAAC;IAC3F,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC;CACnG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"digital-signature-base.js","sourceRoot":"","sources":["../../src-ts/digital-signature/digital-signature-base.ts"],"names":[],"mappings":""}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { DigitalSignatureSHA512Wrapper } from "./digital-siganture-sha-512";
|
|
2
|
-
export declare enum DigitalSignatureType {
|
|
3
|
-
SHA512 = 1,
|
|
4
|
-
SHA256 = 2
|
|
5
|
-
}
|
|
6
|
-
export declare class DigitalSignatureFactory {
|
|
7
|
-
/**
|
|
8
|
-
* Get the appropriate digital signature wrapper based upon the type passed in.
|
|
9
|
-
* @param type
|
|
10
|
-
* @returns
|
|
11
|
-
*/
|
|
12
|
-
static get(type: DigitalSignatureType): DigitalSignatureSHA512Wrapper;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=digital-signature-factory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"digital-signature-factory.d.ts","sourceRoot":"","sources":["../../src-ts/digital-signature/digital-signature-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAG5E,oBAAY,oBAAoB;IAC5B,MAAM,IAAI;IACV,MAAM,IAAI;CACb;AAED,qBAAa,uBAAuB;IAEhC;;;;OAIG;WACW,GAAG,CAAC,IAAI,EAAE,oBAAoB;CAS/C"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DigitalSignatureFactory = exports.DigitalSignatureType = void 0;
|
|
4
|
-
const digital_siganture_sha_512_1 = require("./digital-siganture-sha-512");
|
|
5
|
-
const digital_signaturte_sha_256_1 = require("./digital-signaturte-sha-256");
|
|
6
|
-
var DigitalSignatureType;
|
|
7
|
-
(function (DigitalSignatureType) {
|
|
8
|
-
DigitalSignatureType[DigitalSignatureType["SHA512"] = 1] = "SHA512";
|
|
9
|
-
DigitalSignatureType[DigitalSignatureType["SHA256"] = 2] = "SHA256";
|
|
10
|
-
})(DigitalSignatureType || (exports.DigitalSignatureType = DigitalSignatureType = {}));
|
|
11
|
-
class DigitalSignatureFactory {
|
|
12
|
-
/**
|
|
13
|
-
* Get the appropriate digital signature wrapper based upon the type passed in.
|
|
14
|
-
* @param type
|
|
15
|
-
* @returns
|
|
16
|
-
*/
|
|
17
|
-
static get(type) {
|
|
18
|
-
let ds = new digital_siganture_sha_512_1.DigitalSignatureSHA512Wrapper();
|
|
19
|
-
switch (type) {
|
|
20
|
-
case DigitalSignatureType.SHA256:
|
|
21
|
-
ds = new digital_signaturte_sha_256_1.DigitalSignatureSHA256Wrapper();
|
|
22
|
-
break;
|
|
23
|
-
}
|
|
24
|
-
return ds;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
exports.DigitalSignatureFactory = DigitalSignatureFactory;
|
|
28
|
-
//# sourceMappingURL=digital-signature-factory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"digital-signature-factory.js","sourceRoot":"","sources":["../../src-ts/digital-signature/digital-signature-factory.ts"],"names":[],"mappings":";;;AAAA,2EAA4E;AAC5E,6EAA6E;AAE7E,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC5B,mEAAU,CAAA;IACV,mEAAU,CAAA;AACd,CAAC,EAHW,oBAAoB,oCAApB,oBAAoB,QAG/B;AAED,MAAa,uBAAuB;IAEhC;;;;OAIG;IACI,MAAM,CAAC,GAAG,CAAC,IAA0B;QACxC,IAAI,EAAE,GAAG,IAAI,yDAA6B,EAAE,CAAC;QAC7C,QAAQ,IAAI,EAAE,CAAC;YACX,KAAK,oBAAoB,CAAC,MAAM;gBAC5B,EAAE,GAAG,IAAI,0DAA6B,EAAE,CAAC;gBACzC,MAAM;QACd,CAAC;QACD,OAAO,EAAE,CAAC;IACd,CAAC;CACJ;AAhBD,0DAgBC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { CASRSADigitalSignatureResult } from "../../index";
|
|
2
|
-
import { IDigitalSignature } from "./digital-signature-base";
|
|
3
|
-
export declare class DigitalSignatureSHA256Wrapper implements IDigitalSignature {
|
|
4
|
-
/**
|
|
5
|
-
* Generates and RSA digital signature with SHA3-512
|
|
6
|
-
* @param rsa_key_size
|
|
7
|
-
* @param data_to_sign
|
|
8
|
-
* @returns RsaDigitalSignatureResult
|
|
9
|
-
*/
|
|
10
|
-
createRsa(rsa_key_size: number, data_to_sign: number[]): CASRSADigitalSignatureResult;
|
|
11
|
-
/**
|
|
12
|
-
* Verifies a digital signature created with the RSA public key.
|
|
13
|
-
* @param public_key
|
|
14
|
-
* @param data_to_verify
|
|
15
|
-
* @param signature
|
|
16
|
-
* @returns boolean
|
|
17
|
-
*/
|
|
18
|
-
verifyRSa(public_key: string, data_to_verify: number[], signature: number[]): boolean;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=digital-signaturte-sha-256.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"digital-signaturte-sha-256.d.ts","sourceRoot":"","sources":["../../src-ts/digital-signature/digital-signaturte-sha-256.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAA8D,MAAM,aAAa,CAAC;AAEvH,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,qBAAa,6BAA8B,YAAW,iBAAiB;IAEnE;;;;;OAKG;IAEH,SAAS,CAAC,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,4BAA4B;IAUrF;;;;;;OAMG;IAEH,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO;CAYxF"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DigitalSignatureSHA256Wrapper = void 0;
|
|
4
|
-
const index_1 = require("../../index");
|
|
5
|
-
class DigitalSignatureSHA256Wrapper {
|
|
6
|
-
/**
|
|
7
|
-
* Generates and RSA digital signature with SHA3-512
|
|
8
|
-
* @param rsa_key_size
|
|
9
|
-
* @param data_to_sign
|
|
10
|
-
* @returns RsaDigitalSignatureResult
|
|
11
|
-
*/
|
|
12
|
-
createRsa(rsa_key_size, data_to_sign) {
|
|
13
|
-
if (rsa_key_size !== 1024 && rsa_key_size !== 2048 && rsa_key_size !== 4096) {
|
|
14
|
-
throw new Error("You need to provide an appropriate RSA key size.");
|
|
15
|
-
}
|
|
16
|
-
if (data_to_sign?.length === 0) {
|
|
17
|
-
throw new Error("Must provide allocated data to sign");
|
|
18
|
-
}
|
|
19
|
-
return (0, index_1.sha256RsaDigitalSignature)(rsa_key_size, data_to_sign);
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Verifies a digital signature created with the RSA public key.
|
|
23
|
-
* @param public_key
|
|
24
|
-
* @param data_to_verify
|
|
25
|
-
* @param signature
|
|
26
|
-
* @returns boolean
|
|
27
|
-
*/
|
|
28
|
-
verifyRSa(public_key, data_to_verify, signature) {
|
|
29
|
-
if (!public_key) {
|
|
30
|
-
throw new Error("Must provide a public key");
|
|
31
|
-
}
|
|
32
|
-
if (data_to_verify?.length === 0) {
|
|
33
|
-
throw new Error("Must provide an allocated data to verify");
|
|
34
|
-
}
|
|
35
|
-
if (signature?.length === 0) {
|
|
36
|
-
throw new Error("Must provide an allocated signature");
|
|
37
|
-
}
|
|
38
|
-
return (0, index_1.sha256RsaVerifyDigitalSignature)(public_key, data_to_verify, signature);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
exports.DigitalSignatureSHA256Wrapper = DigitalSignatureSHA256Wrapper;
|
|
42
|
-
//# sourceMappingURL=digital-signaturte-sha-256.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"digital-signaturte-sha-256.js","sourceRoot":"","sources":["../../src-ts/digital-signature/digital-signaturte-sha-256.ts"],"names":[],"mappings":";;;AAAA,uCAAuH;AAIvH,MAAa,6BAA6B;IAEtC;;;;;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;IAEH,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;AAvCD,sEAuCC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { DigitalSignatureType } from "./digital-signature-factory";
|
|
2
|
-
import { DigitalSignatureFactory } from "./digital-signature-factory";
|
|
3
|
-
import { DigitalSignatureSHA256Wrapper } from "./digital-signaturte-sha-256";
|
|
4
|
-
import { DigitalSignatureSHA512Wrapper } from "./digital-siganture-sha-512";
|
|
5
|
-
import { CASRSADigitalSignatureResult, CASSHAED25519DalekDigitalSignatureResult } from "../../index";
|
|
6
|
-
export { DigitalSignatureFactory, DigitalSignatureSHA256Wrapper, DigitalSignatureSHA512Wrapper, DigitalSignatureType, CASSHAED25519DalekDigitalSignatureResult, CASRSADigitalSignatureResult };
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src-ts/digital-signature/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,4BAA4B,EAAE,wCAAwC,EAAE,MAAM,aAAa,CAAC;AAErG,OAAO,EACL,uBAAuB,EACvB,6BAA6B,EAC7B,6BAA6B,EAC7B,oBAAoB,EACpB,wCAAwC,EACxC,4BAA4B,EAC7B,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DigitalSignatureType = exports.DigitalSignatureSHA512Wrapper = exports.DigitalSignatureSHA256Wrapper = exports.DigitalSignatureFactory = void 0;
|
|
4
|
-
const digital_signature_factory_1 = require("./digital-signature-factory");
|
|
5
|
-
Object.defineProperty(exports, "DigitalSignatureType", { enumerable: true, get: function () { return digital_signature_factory_1.DigitalSignatureType; } });
|
|
6
|
-
const digital_signature_factory_2 = require("./digital-signature-factory");
|
|
7
|
-
Object.defineProperty(exports, "DigitalSignatureFactory", { enumerable: true, get: function () { return digital_signature_factory_2.DigitalSignatureFactory; } });
|
|
8
|
-
const digital_signaturte_sha_256_1 = require("./digital-signaturte-sha-256");
|
|
9
|
-
Object.defineProperty(exports, "DigitalSignatureSHA256Wrapper", { enumerable: true, get: function () { return digital_signaturte_sha_256_1.DigitalSignatureSHA256Wrapper; } });
|
|
10
|
-
const digital_siganture_sha_512_1 = require("./digital-siganture-sha-512");
|
|
11
|
-
Object.defineProperty(exports, "DigitalSignatureSHA512Wrapper", { enumerable: true, get: function () { return digital_siganture_sha_512_1.DigitalSignatureSHA512Wrapper; } });
|
|
12
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src-ts/digital-signature/index.ts"],"names":[],"mappings":";;;AAAA,2EAAmE;AAUjE,qGAVO,gDAAoB,OAUP;AATtB,2EAAsE;AAMpE,wGANO,mDAAuB,OAMP;AALzB,6EAA6E;AAM3E,8GANO,0DAA6B,OAMP;AAL/B,2EAA4E;AAM1E,8GANO,yDAA6B,OAMP"}
|