@vchasno/signer 1.0.0 → 1.0.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +85 -30
- package/lib/vchasnoSigner.esm.js +1 -0
- package/lib/vchasnoSigner.js +1 -9066
- package/package.json +66 -50
- package/.dockerignore +0 -11
- package/CHANGELOG.md +0 -580
- package/Dockerfile +0 -14
- package/docker/entrypoint.sh +0 -15
- package/justfile +0 -23
- package/scripts/generateCAServers.js +0 -45
- package/scripts/rawCAs.json +0 -424
- package/scripts/testCAs.json +0 -14
- package/scripts/versionBump.js +0 -73
- package/scripts/weights.json +0 -106
package/index.d.ts
CHANGED
|
@@ -12,12 +12,12 @@ declare namespace VchasnoSigner {
|
|
|
12
12
|
*/
|
|
13
13
|
proxyServiceUrl: string;
|
|
14
14
|
/**
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
* Allow to use only power certificates
|
|
16
|
+
*/
|
|
17
17
|
checkIsPowerCertificate?: boolean;
|
|
18
18
|
/**
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
* download sign library from specific url
|
|
20
|
+
*/
|
|
21
21
|
downloadSignLibraryUrl?: string;
|
|
22
22
|
/**
|
|
23
23
|
* Max data size to work with in bytes, library will take 10x size in memory
|
|
@@ -81,7 +81,7 @@ declare namespace VchasnoSigner {
|
|
|
81
81
|
certificateInfo: CertificateInfo;
|
|
82
82
|
}
|
|
83
83
|
interface KeyCtxCAIdx extends KeyCtx {
|
|
84
|
-
caServerIdx: number
|
|
84
|
+
caServerIdx: number;
|
|
85
85
|
}
|
|
86
86
|
interface CertificateInfo {
|
|
87
87
|
publicKeyID: string;
|
|
@@ -155,17 +155,23 @@ declare namespace VchasnoSigner {
|
|
|
155
155
|
function base64Decode(data: string): Promise<Uint8Array>;
|
|
156
156
|
function clearKeyCtx(keyContextId: string): Promise<void>;
|
|
157
157
|
function clearKeysCtx(): Promise<void>;
|
|
158
|
-
function generatePrivateKey(
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
158
|
+
function generatePrivateKey(
|
|
159
|
+
pkPassword: string,
|
|
160
|
+
isStamp: boolean,
|
|
161
|
+
): Promise<GeneratedKeyData>;
|
|
162
|
+
function generatePrivateKeyExt(
|
|
163
|
+
pkPassword: string,
|
|
164
|
+
params?: Partial<{
|
|
165
|
+
uaKeysType: number;
|
|
166
|
+
uaDSKeysSpec: number;
|
|
167
|
+
useDSKeyAsKEP: boolean;
|
|
168
|
+
uaKepSpec: number;
|
|
169
|
+
intKeysType: number;
|
|
170
|
+
intKeysSpec: number;
|
|
171
|
+
userInfo: unknown;
|
|
172
|
+
extKeyUsages: string;
|
|
173
|
+
}>,
|
|
174
|
+
): Promise<GeneratedKeyDataExt>;
|
|
169
175
|
function getCAServers(): Promise<CaServer[]>;
|
|
170
176
|
function getCAServerSettings(caServer: CaServer): Promise<CaServerSetting>;
|
|
171
177
|
function getRootCertificates(enableTestCertificates?: boolean): Uint8Array;
|
|
@@ -186,25 +192,74 @@ declare namespace VchasnoSigner {
|
|
|
186
192
|
key: KeyCtx,
|
|
187
193
|
asBase64String: boolean | null,
|
|
188
194
|
): Promise<Uint8Array | String>;
|
|
189
|
-
function developDataCtx(
|
|
190
|
-
|
|
195
|
+
function developDataCtx(
|
|
196
|
+
data: Data,
|
|
197
|
+
recipientCert: Blob,
|
|
198
|
+
key: KeyCtx,
|
|
199
|
+
): Promise<Uint8Array>;
|
|
200
|
+
function unprotectReceipt(
|
|
201
|
+
reportData: Data,
|
|
202
|
+
key: KeyCtx,
|
|
203
|
+
): Promise<ReceiptResult>;
|
|
191
204
|
function readJksFile(keyFile: Blob): Promise<JksKey[]>;
|
|
192
|
-
function readJksKeyCtx(
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
205
|
+
function readJksKeyCtx(
|
|
206
|
+
keyData: Uint8Array,
|
|
207
|
+
certificates: Uint8Array[],
|
|
208
|
+
password: string,
|
|
209
|
+
caServerIdx: number,
|
|
210
|
+
): Promise<Key>;
|
|
211
|
+
function readKey(
|
|
212
|
+
keyFile: Blob,
|
|
213
|
+
password: string,
|
|
214
|
+
caServerIdx: number,
|
|
215
|
+
certificateFiles?: FileList,
|
|
216
|
+
): Promise<Key>;
|
|
217
|
+
function readKeyCtx(
|
|
218
|
+
keyFile: Blob,
|
|
219
|
+
password: string,
|
|
220
|
+
caServerIdx: number,
|
|
221
|
+
certificateFiles?: FileList,
|
|
222
|
+
): Promise<KeyCtx>;
|
|
223
|
+
function readPKKeyCtxWithCMP(
|
|
224
|
+
keyFile: Blob,
|
|
225
|
+
password: string,
|
|
226
|
+
): Promise<KeyCtxCAIdx>;
|
|
227
|
+
function signData(
|
|
228
|
+
data: Data,
|
|
229
|
+
keys: Key | Key[],
|
|
230
|
+
): Promise<Signature | Signature[]>;
|
|
197
231
|
function signDataCtx(data: Data): Promise<Signature[]>;
|
|
198
|
-
function signDataInternal(
|
|
232
|
+
function signDataInternal(
|
|
233
|
+
data: Data,
|
|
234
|
+
keys: Key | Key[],
|
|
235
|
+
): Promise<[Signature | Signature[], Data]>;
|
|
199
236
|
function signDataInternalCtx(data: Data): Promise<[Signature[], Data]>;
|
|
200
|
-
function signDataInternalAppendedCtx(
|
|
237
|
+
function signDataInternalAppendedCtx(
|
|
238
|
+
data: Data,
|
|
239
|
+
): Promise<[Signature[], Data]>;
|
|
201
240
|
function signHashCtx(data: string): Promise<Signature[]>;
|
|
202
|
-
function signDataDFS(
|
|
241
|
+
function signDataDFS(
|
|
242
|
+
data: Blob | ArrayBuffer,
|
|
243
|
+
signKeys: Key[],
|
|
244
|
+
cypherKey: Key[],
|
|
245
|
+
): Promise<[Signature[], Data]>;
|
|
203
246
|
function unprotectData(data: string): Promise<string>;
|
|
204
247
|
function verifySign(data: Data, eSign: Signature): Promise<SignatureInfo>;
|
|
205
|
-
function verifySignInternal(
|
|
206
|
-
|
|
207
|
-
|
|
248
|
+
function verifySignInternal(
|
|
249
|
+
p7s: Data,
|
|
250
|
+
withData: boolean,
|
|
251
|
+
): Promise<SignatureInfo>;
|
|
252
|
+
function createClientSession(
|
|
253
|
+
duration: number,
|
|
254
|
+
certificate: Uint8Array,
|
|
255
|
+
): Promise<SessionData>;
|
|
256
|
+
function sessionEncrypt(
|
|
257
|
+
data: Uint8Array | string,
|
|
258
|
+
asBase64String?: boolean,
|
|
259
|
+
): Promise<Uint8Array | string>;
|
|
208
260
|
function sessionDecrypt(data: Uint8Array | string): Promise<Uint8Array>;
|
|
209
|
-
function hashData(
|
|
261
|
+
function hashData(
|
|
262
|
+
data: Uint8Array | string,
|
|
263
|
+
asBase64String?: boolean,
|
|
264
|
+
): Promise<Uint8Array | string>;
|
|
210
265
|
}
|