@it-enterprise/digital-signature 1.1.7 → 1.2.0

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.
@@ -177,6 +177,12 @@ export declare enum EndUserKSP {
177
177
  PB,
178
178
  DIIA
179
179
  }
180
+ export declare enum EndUserKSPClientIdType {
181
+ Default = 0,
182
+ Name = 1,
183
+ Phone = 2,
184
+ Email = 3
185
+ }
180
186
  export declare const EU_SIGN_TYPE_UNKNOWN = 0;
181
187
  export declare const EU_SIGN_TYPE_CADES_BES = 1;
182
188
  export declare const EU_SIGN_TYPE_CADES_T = 4;
@@ -191,6 +197,14 @@ export declare enum EndUserSignType {
191
197
  CAdES_X_Long,
192
198
  CAdES_X_Long_Trusted
193
199
  }
200
+ export declare const EU_CADES_TYPE_UNKNOWN = 0;
201
+ export declare const EU_CADES_TYPE_DETACHED = 1;
202
+ export declare const EU_CADES_TYPE_ENVELOPED = 3;
203
+ export declare enum EndUserCAdESType {
204
+ Unknown,
205
+ Detached,
206
+ Enveloped
207
+ }
194
208
  export declare const EU_CTX_SIGN_UNKNOWN = 0;
195
209
  export declare const EU_CTX_SIGN_DSTU4145_WITH_GOST34311 = 1;
196
210
  export declare const EU_CTX_SIGN_RSA_WITH_SHA = 2;
@@ -238,18 +252,6 @@ export declare enum EndUserASiCSignType {
238
252
  CAdES,
239
253
  XAdES
240
254
  }
241
- export declare const EU_ASIC_SIGN_LEVEL_BES = 1;
242
- export declare const EU_ASIC_SIGN_LEVEL_T = 4;
243
- export declare const EU_ASIC_SIGN_LEVEL_C = 8;
244
- export declare const EU_ASIC_SIGN_LEVEL_X_LONG = 16;
245
- export declare const EU_ASIC_SIGN_LEVEL_X_LONG_TRUSTED = 128;
246
- export declare enum EndUserASiCSignLevel {
247
- BES,
248
- T,
249
- C,
250
- X_Long,
251
- X_Long_Trusted
252
- }
253
255
  export declare const EU_XADES_TYPE_UNKNOWN = 0;
254
256
  export declare const EU_XADES_TYPE_DETACHED = 1;
255
257
  export declare const EU_XADES_TYPE_ENVELOPING = 2;
@@ -260,20 +262,40 @@ export declare enum EndUserXAdESType {
260
262
  Enveloping,
261
263
  Enveloped
262
264
  }
263
- export declare const EU_XADES_SIGN_LEVEL_BES = 1;
264
- export declare const EU_XADES_SIGN_LEVEL_T = 4;
265
- export declare const EU_XADES_SIGN_LEVEL_C = 8;
266
- export declare const EU_XADES_SIGN_LEVEL_X_LONG = 16;
267
- export declare const EU_XADES_SIGN_LEVEL_X_LONG_TRUSTED = 128;
265
+ export declare const EU_XADES_SIGN_LEVEL_UNKNOWN = 0;
266
+ export declare const EU_XADES_SIGN_LEVEL_B_B = 1;
267
+ export declare const EU_XADES_SIGN_LEVEL_B_T = 4;
268
+ export declare const EU_XADES_SIGN_LEVEL_B_LT = 16;
269
+ export declare const EU_XADES_SIGN_LEVEL_B_LTA = 32;
268
270
  export declare enum EndUserXAdESSignLevel {
269
- BES,
270
- T,
271
- C,
272
- X_Long,
273
- X_Long_Trusted
271
+ Unknown,
272
+ B_B,
273
+ B_T,
274
+ B_LT,
275
+ B_LTA
276
+ }
277
+ export declare const EU_PADES_SIGN_LEVEL_UNKNOWN = 0;
278
+ export declare const EU_PADES_SIGN_LEVEL_B_B = 1;
279
+ export declare const EU_PADES_SIGN_LEVEL_B_T = 4;
280
+ export declare enum EndUserPAdESSignLevel {
281
+ Unknown,
282
+ B_B,
283
+ B_T
274
284
  }
275
285
  export declare enum EndUserEventType {
276
286
  None = 0,
277
287
  All = 1,
278
288
  ConfirmKSPOperation = 2
279
289
  }
290
+ export declare const EU_SIGN_CONTAINER_TYPE_UNKNOWN = 0;
291
+ export declare const EU_SIGN_CONTAINER_TYPE_CADES = 1;
292
+ export declare const EU_SIGN_CONTAINER_TYPE_XADES = 2;
293
+ export declare const EU_SIGN_CONTAINER_TYPE_PADES = 3;
294
+ export declare const EU_SIGN_CONTAINER_TYPE_ASIC = 4;
295
+ export declare enum EndUserSignContainerType {
296
+ Unknown,
297
+ CAdES,
298
+ XAdES,
299
+ PAdES,
300
+ ASiC
301
+ }
@@ -1,4 +1,4 @@
1
- import { EndUserKSP } from "./EndUserConstants";
1
+ import { EndUserKSP, EndUserKSPClientIdType } from "./EndUserConstants";
2
2
  /**
3
3
  * CA configuration.
4
4
  * @property <Array<string>> issuerCNs - An array with CA common names.
@@ -38,6 +38,7 @@ export declare class CASettings {
38
38
  * @property <string | null> mobileAppName - KSP server mobile application name.
39
39
  * @property <number | null> pollingInterval - KSP server polling interval in seconds.
40
40
  * @property <string | null> systemId - System identifier (website, system name, etc).
41
+ * @property <EndUserKSPClientIdType | null> clientIdType - Client ID type (name, phone, email).
41
42
  */
42
43
  export declare class KSPSettings {
43
44
  name: string;
@@ -50,6 +51,7 @@ export declare class KSPSettings {
50
51
  mobileAppName?: string;
51
52
  pollingInterval?: number;
52
53
  systemId?: string;
54
+ clientIdType?: EndUserKSPClientIdType;
53
55
  }
54
56
  /**
55
57
  * Settings to configure EndUser library.
@@ -0,0 +1,10 @@
1
+ import { EndUserSignContainerType, EndUserCAdESType, EndUserXAdESType, EndUserASiCType, EndUserASiCSignType } from "./EndUserConstants";
2
+ /**
3
+ * Sign container info.
4
+ */
5
+ export declare class EndUserSignContainerInfo {
6
+ type: EndUserSignContainerType;
7
+ subType: EndUserCAdESType | EndUserXAdESType | EndUserASiCType;
8
+ asicSignType: EndUserASiCSignType;
9
+ constructor();
10
+ }
@@ -1,5 +1,6 @@
1
1
  import { EndUserTimeInfo } from "./EndUserTimeInfo";
2
2
  import { EndUserOwnerInfo } from "./EndUserOwnerInfo";
3
+ import { EndUserSignType, EndUserXAdESSignLevel, EndUserPAdESSignLevel } from "./EndUserConstants";
3
4
  /**
4
5
  * Signature information.
5
6
  */
@@ -7,4 +8,5 @@ export declare class EndUserSignInfo {
7
8
  ownerInfo: EndUserOwnerInfo;
8
9
  timeInfo: EndUserTimeInfo;
9
10
  data?: Uint8Array;
11
+ signLevel: EndUserSignType | EndUserXAdESSignLevel | EndUserPAdESSignLevel;
10
12
  }
package/euscp/euscp.d.ts CHANGED
@@ -7,10 +7,11 @@ import { EndUserCertificate } from "./EndUserCertificate";
7
7
  import { EndUserKeyMedia } from "./EndUserKeyMedia";
8
8
  import { EndUserJKSPrivateKeyInfo } from "./EndUserJKSPrivateKeyInfo";
9
9
  import { EndUserContext, EndUserPrivateKeyContext } from "./EndUserContexts";
10
- import { EndUserLibraryType, EndUserSignType, EndUserMobileOperatorID, EndUserKSP, EndUserCCSType, EndUserRevocationReason, EndUserKeysType, EndUserKeysLengthDSUA, EndUserKeysLengthKEPUA, EndUserKeysLengthDSRSA, EndUserSignAlgo, EndUserHashAlgo, EndUserEventType, EndUserASiCType, EndUserASiCSignType, EndUserASiCSignLevel, EndUserXAdESType, EndUserXAdESSignLevel } from "./EndUserConstants";
10
+ import { EndUserLibraryType, EndUserSignType, EndUserMobileOperatorID, EndUserKSP, EndUserCCSType, EndUserRevocationReason, EndUserKeysType, EndUserKeysLengthDSUA, EndUserKeysLengthKEPUA, EndUserKeysLengthDSRSA, EndUserSignAlgo, EndUserHashAlgo, EndUserEventType, EndUserASiCType, EndUserASiCSignType, EndUserXAdESType, EndUserXAdESSignLevel } from "./EndUserConstants";
11
11
  import * as EndUserConstants from "./EndUserConstants";
12
12
  import { EndUserTaxReport, EndUserTaxReceipt } from "./EndUserTaxReports";
13
13
  import { EndUserTimeInfo } from "./EndUserTimeInfo";
14
+ import { EndUserSignContainerInfo } from "./EndUserSignContainerInfo";
14
15
  import { EndUserSignInfo } from "./EndUserSignInfo";
15
16
  import { EndUserSenderInfo } from "./EndUserSenderInfo";
16
17
  import { EndUserParams } from "./EndUserParams";
@@ -208,6 +209,14 @@ declare class EndUser {
208
209
  * @returns A Promise for the completion of which ever callback is executed.
209
210
  */
210
211
  ChangePrivateKeyPassword(keyMedia: EndUserKeyMedia, newPassword: string): Promise<void>;
212
+ /**
213
+ * Change private key password for software(file) key
214
+ * @param privateKey The private key in array of bytes.
215
+ * @param password The private key password.
216
+ * @param newPassword The new private key password.
217
+ * @returns A Promise for the completion of which ever callback is executed.
218
+ */
219
+ ChangePrivateKeyPasswordBinary(privateKey: Uint8Array, password: string, newPassword: string): Promise<Uint8Array>;
211
220
  /**
212
221
  * Generate new private key to key media
213
222
  * @param keyMedia The key media. Old private key will be deleted.
@@ -555,12 +564,22 @@ declare class EndUser {
555
564
  * @param signAlgo The algorithm of the signature.
556
565
  * @param asicType The ASiC type (ASiC-S or ASiC-E).
557
566
  * @param signType The ASiC signature type (CAdES or XAdES).
558
- * @param signLevel The ASiC signature level (-BES, -T, -C, -X-Long etc).
567
+ * @param signLevel The ASiC signature level (XAdES (-B-B, -B-T, -B-LT, -B-LTA) or CAdES (-BES, -T, -C, -X-Long etc)).
559
568
  * @param references The references of file(s) to sign.
560
569
  * @param asBase64String The boolean value that specifies whether to encode a signature into a BASE64 string.
561
570
  * @returns A Promise for the completion of which ever callback is executed.
562
571
  */
563
- ASiCSignData(signAlgo: EndUserSignAlgo | number, asicType: EndUserASiCType | number, signType: EndUserASiCSignType | number, signLevel: EndUserASiCSignLevel | number, references: Array<NamedData>, asBase64String: boolean): Promise<NamedData>;
572
+ ASiCSignData(signAlgo: EndUserSignAlgo | number, asicType: EndUserASiCType | number, signType: EndUserASiCSignType | number, signLevel: EndUserSignType | EndUserXAdESSignLevel | number, references: Array<NamedData>, asBase64String: boolean): Promise<NamedData>;
573
+ /**
574
+ * Create ASiC (Associated Signature Container) using private key
575
+ * @param signAlgo The algorithm of the signature.
576
+ * @param signLevel The ASiC signature level (XAdES (-B-B, -B-T, -B-LT, -B-LTA) or CAdES (-BES, -T, -C, -X-Long etc)).
577
+ * @param referencesNames The references names of file(s) to sign in container or null to sign all.
578
+ * @param asicData The ASiC to append sign (ASiC in string will be decoded from BASE64 string).
579
+ * @param asBase64String The boolean value that specifies whether to encode a signature into a BASE64 string.
580
+ * @returns A Promise for the completion of which ever callback is executed.
581
+ */
582
+ ASiCAppendSign(signAlgo: EndUserSignAlgo | number, signLevel: EndUserSignType | EndUserXAdESSignLevel | number, referencesNames: Array<string>, asicData: Uint8Array | string | NamedData, asBase64String: boolean): Promise<NamedData>;
564
583
  /**
565
584
  * Verify ASiC (Associated Signature Container)
566
585
  * @param asicData The ASiC to verify (ASiC in string will be decoded from BASE64 string).
@@ -618,5 +637,11 @@ declare class EndUser {
618
637
  * @returns A Promise for the completion of which ever callback is executed.
619
638
  */
620
639
  XAdESVerifyData(references: Array<NamedData>, xadesData: Uint8Array | string, signIndex?: number): Promise<EndUserSignInfo | Array<EndUserSignInfo>>;
640
+ /**
641
+ * Get sign container info
642
+ * @param signedData The signed data (CAdES, XAdES, PAdES or ASiC)
643
+ * @returns A Promise for the completion of which ever callback is executed.
644
+ */
645
+ GetSignContainerInfo(signedData: Uint8Array | string): Promise<EndUserSignContainerInfo>;
621
646
  }
622
- export { NamedData, CASettings, KSPSettings, EndUserError, EndUserConstants, EndUserEvents, EndUserLibraryInfoJS, EndUserLibraryInfoSW, EndUserSettings, EndUserProxySettings, EndUserOwnerInfo, EndUserCertificateInfoEx, EndUserCertificate, EndUserKeyMedia, EndUserJKSPrivateKeyInfo, EndUserContext, EndUserPrivateKeyContext, EndUserTimeInfo, EndUserSignInfo, EndUserSenderInfo, EndUserParams, EndUserInfo, EndUserRequestInfo, EndUserTaxReport, EndUserTaxReceipt, EndUser };
647
+ export { NamedData, CASettings, KSPSettings, EndUserError, EndUserConstants, EndUserEvents, EndUserLibraryInfoJS, EndUserLibraryInfoSW, EndUserSettings, EndUserProxySettings, EndUserOwnerInfo, EndUserCertificateInfoEx, EndUserCertificate, EndUserKeyMedia, EndUserJKSPrivateKeyInfo, EndUserContext, EndUserPrivateKeyContext, EndUserTimeInfo, EndUserSignContainerInfo, EndUserSignInfo, EndUserSenderInfo, EndUserParams, EndUserInfo, EndUserRequestInfo, EndUserTaxReport, EndUserTaxReceipt, EndUser };