@vchasno/signer 1.0.0 → 1.0.1-beta.1

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 CHANGED
@@ -12,12 +12,12 @@ declare namespace VchasnoSigner {
12
12
  */
13
13
  proxyServiceUrl: string;
14
14
  /**
15
- * Allow to use only power certificates
16
- */
15
+ * Allow to use only power certificates
16
+ */
17
17
  checkIsPowerCertificate?: boolean;
18
18
  /**
19
- * download sign library from specific url
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(pkPassword: string, isStamp: boolean): Promise<GeneratedKeyData>;
159
- function generatePrivateKeyExt(pkPassword: string, params?: Partial<{
160
- uaKeysType: number,
161
- uaDSKeysSpec: number,
162
- useDSKeyAsKEP: boolean,
163
- uaKepSpec: number,
164
- intKeysType: number,
165
- intKeysSpec: number,
166
- userInfo: unknown,
167
- extKeyUsages: string,
168
- }>): Promise<GeneratedKeyDataExt>;
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(data: Data, recipientCert: Blob, key: KeyCtx): Promise<Uint8Array>;
190
- function unprotectReceipt(reportData: Data, key: KeyCtx): Promise<ReceiptResult>;
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(keyData: Uint8Array, certificates: Uint8Array[], password: string, caServerIdx: number): Promise<Key>;
193
- function readKey(keyFile: Blob, password: string, caServerIdx: number, certificateFiles?: FileList): Promise<Key>;
194
- function readKeyCtx(keyFile: Blob, password: string, caServerIdx: number, certificateFiles?: FileList): Promise<KeyCtx>;
195
- function readPKKeyCtxWithCMP(keyFile: Blob, password: string): Promise<KeyCtxCAIdx>;
196
- function signData(data: Data, keys: Key | Key[]): Promise<Signature | Signature[]>;
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(data: Data, keys: Key | Key[]): Promise<[Signature | Signature[], Data]>;
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(data: Data): Promise<[Signature[], Data]>;
237
+ function signDataInternalAppendedCtx(
238
+ data: Data,
239
+ ): Promise<[Signature[], Data]>;
201
240
  function signHashCtx(data: string): Promise<Signature[]>;
202
- function signDataDFS(data: Blob | ArrayBuffer, signKeys: Key[], cypherKey: Key[]): Promise<[Signature[], Data]>;
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(p7s: Data, withData: boolean): Promise<SignatureInfo>;
206
- function createClientSession(duration: number, certificate: Uint8Array): Promise<SessionData>;
207
- function sessionEncrypt(data: Uint8Array | string, asBase64String?: boolean): Promise<Uint8Array | string>;
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(data: Uint8Array | string, asBase64String?: boolean): Promise<Uint8Array | string>;
261
+ function hashData(
262
+ data: Uint8Array | string,
263
+ asBase64String?: boolean,
264
+ ): Promise<Uint8Array | string>;
210
265
  }