web-pki 2.16.2 → 2.16.4

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.
@@ -324,37 +324,36 @@ export declare class LacunaWebPKI {
324
324
  usePreauthorizedSignatures?: boolean
325
325
  }): Promise<SignHashBatchResponse>;
326
326
 
327
- // TODO: next version
328
- // /**************************************************************
329
- // * Signs a batch of hashes with signer certificate private key.
330
- // *
331
- // * @returns A promise object that can register [[fail]] and [[success]] callbacks to be called when the operation completes. The [[success]] callback for this promise receives the (Base64 encoded) signature bytes array.
332
- // *
333
- // * Usage example (JavaScript)
334
- // * ```javascript
335
- // * var hashes = [
336
- // * { algorithm: 'SHA-256', value: 'f4OxZX/x/FO5LcGBSKHWXfwtSx+j1ncoSt3SABJtkGk=' }, // Base64 encoded SHA-256 of 'Hello World!'
337
- // * { algorithm: 'SHA-256', value: 'f4OxZX/x/FO5LcGBSKHWXfwtSx+j1ncoSt3SABJtkGk=' },
338
- // * { algorithm: 'SHA-256', value: 'f4OxZX/x/FO5LcGBSKHWXfwtSx+j1ncoSt3SABJtkGk=' }
339
- // * ];
340
- // *
341
- // * pki.signHashes({
342
- // * certificateThumbprint: $('#certificateSelect').val(),
343
- // * hashes: hashes
344
- // * }).success(function (result) {
345
- // * // Use signatures array
346
- // * var signatures = result.signatures;
347
- // * });
348
- // * ```
349
- // *
350
- // * JSFiddle live example: [Sign Hashes](https://jsfiddle.net/LacunaSoftware/1car2yjz)
351
- // */
352
- // signHashes(args: {
353
- // /** The signer certificate thumbprint. Available in [[CertificateModel.thumbprint]] property returned by [[listCertificates]] method. */
354
- // certificateThumbprint: string,
355
- // /** The Array of [[Hash]] with the hash algorithm and value to be signed. */
356
- // hashes: Hash[],
357
- // }): Promise<SignHashesResponse>;
327
+ /**************************************************************
328
+ * Signs a batch of hashes with signer certificate private key.
329
+ *
330
+ * @returns A promise object that can register [[fail]] and [[success]] callbacks to be called when the operation completes. The [[success]] callback for this promise receives the (Base64 encoded) signature bytes array.
331
+ *
332
+ * Usage example (JavaScript)
333
+ * ```javascript
334
+ * var hashes = [
335
+ * { algorithm: 'SHA-256', value: 'f4OxZX/x/FO5LcGBSKHWXfwtSx+j1ncoSt3SABJtkGk=' }, // Base64 encoded SHA-256 of 'Hello World!'
336
+ * { algorithm: 'SHA-256', value: 'f4OxZX/x/FO5LcGBSKHWXfwtSx+j1ncoSt3SABJtkGk=' },
337
+ * { algorithm: 'SHA-256', value: 'f4OxZX/x/FO5LcGBSKHWXfwtSx+j1ncoSt3SABJtkGk=' }
338
+ * ];
339
+ *
340
+ * pki.signHashes({
341
+ * certificateThumbprint: $('#certificateSelect').val(),
342
+ * hashes: hashes
343
+ * }).success(function (result) {
344
+ * // Use signatures array
345
+ * var signatures = result.signatures;
346
+ * });
347
+ * ```
348
+ *
349
+ * JSFiddle live example: [Sign Hashes](https://jsfiddle.net/LacunaSoftware/1car2yjz)
350
+ */
351
+ signHashes(args: {
352
+ /** The signer certificate thumbprint. Available in [[CertificateModel.thumbprint]] property returned by [[listCertificates]] method. */
353
+ certificateThumbprint: string,
354
+ /** The Array of [[Hash]] with the hash algorithm and value to be signed. */
355
+ hashes: Hash[],
356
+ }): Promise<SignHashesResponse>;
358
357
 
359
358
  /**************************************************************
360
359
  * Executes a document signature with Rest PKI (server-side) integration. See [Rest PKI documentation](https://docs.lacunasoftware.com/articles/rest-pki/) for more informations.
@@ -539,21 +538,20 @@ export declare class LacunaWebPKI {
539
538
  /** If `true`, will not apply the `pdfMarks` in case PDF already has a signature. If `false`, any previous signature will be removed before the marks be applied. */
540
539
  bypassMarksIfSigned?: boolean,
541
540
 
542
- // TODO: next version
543
- // /** A signing reason */
544
- // reason?: string,
541
+ /** A signing reason */
542
+ reason?: string,
545
543
 
546
- // /** The signing location or address */
547
- // location?: string,
544
+ /** The signing location or address */
545
+ location?: string,
548
546
 
549
- // /** The signer name */
550
- // signerName?: string,
547
+ /** The signer name */
548
+ signerName?: string,
551
549
 
552
- // /** A custom signature field name. Signature field name must be unique for the PDF */
553
- // customSignatureFieldName?: string,
550
+ /** A custom signature field name. Signature field name must be unique for the PDF */
551
+ customSignatureFieldName?: string,
554
552
 
555
- // /** Any metadata to be added to the PDF */
556
- // metadata?: { [key: string]: string; },
553
+ /** Any metadata to be added to the PDF */
554
+ metadata?: { [key: string]: string; },
557
555
 
558
556
  /** The PDF signature policy. */
559
557
  policy: LacunaWebPKI.PadesPolicies,
@@ -598,9 +596,8 @@ export declare class LacunaWebPKI {
598
596
  /** If you already have a CAdES file and a co-signature is intended, pass this argument instead of `fileId` or `content`. Optionally, you can use the `fileId` for CAdES signature file and enable the `autoDetectCosign`. */
599
597
  cmsToCosignFileId?: string,
600
598
 
601
- // TODO: next version
602
- // /** If you already have a CAdES file and a co-signature is intended, pass this argument instead of `fileId` or `content`. Optionally, you can use the `fileId` for CAdES signature file and enable the `autoDetectCosign`. */
603
- // cmsToCosignContent?: string,
599
+ /** If you already have a CAdES file and a co-signature is intended, pass this argument instead of `fileId` or `content`. Optionally, you can use the `fileId` for CAdES signature file and enable the `autoDetectCosign`. */
600
+ cmsToCosignContent?: string,
604
601
 
605
602
  /** Whether or not to auto-detect a co-signature intention if the `fileId` passed is a CAdES signature file. */
606
603
  autoDetectCosign?: boolean,
@@ -608,9 +605,8 @@ export declare class LacunaWebPKI {
608
605
  /** Whether or not to include the encapsulated content (the original document) in the resulting CAdES signature file. */
609
606
  includeEncapsulatedContent?: boolean,
610
607
 
611
- // TODO: next version
612
- // /** A signing description or reason */
613
- // signingDescription?: string,
608
+ /** A signing description or reason */
609
+ signingDescription?: string,
614
610
 
615
611
  /** The CAdES signature policy. */
616
612
  policy: LacunaWebPKI.CadesPolicies,
@@ -646,9 +642,8 @@ export declare class LacunaWebPKI {
646
642
  /** A XML content (UTF-8 string or Base64 encoded bytes) to sign can be passed optionally to `filedId`. */
647
643
  content?: string,
648
644
 
649
- // TODO: next version
650
- // /** A signing description or reason */
651
- // signingDescription?: string,
645
+ /** A signing description or reason */
646
+ signingDescription?: string,
652
647
 
653
648
  /** The XML signature policy. */
654
649
  policy: LacunaWebPKI.XmlPolicies,
@@ -705,9 +700,8 @@ export declare class LacunaWebPKI {
705
700
  /** A XML content (UTF-8 string or Base64 encoded) to sign can be passed optionally to `filedId`. */
706
701
  content?: string,
707
702
 
708
- // TODO: next version
709
- // /** A signing description or reason */
710
- // signingDescription?: string,
703
+ /** A signing description or reason */
704
+ signingDescription?: string,
711
705
 
712
706
  /** The XML signature policy. */
713
707
  policy: LacunaWebPKI.XmlPolicies,
@@ -769,11 +763,11 @@ export declare class LacunaWebPKI {
769
763
  /** The original file. Only applies if the passed `signatureFileId` or `signatureContent` does not have the encapsulated content. */
770
764
  originalFileId?: string,
771
765
 
772
- // TODO: next version
773
- // /** The original file content (Base64 encoded bytes). Only applies if the passed `signatureFileId` or `signatureContent` does not have the encapsulated content. */
774
- // originalContent?: string,
775
- // /** Set to return the encapsulated content */
776
- // returnEncapsulatedContent?: boolean,
766
+ /** The original file content (Base64 encoded bytes). Only applies if the passed `signatureFileId` or `signatureContent` does not have the encapsulated content. */
767
+ originalContent?: string,
768
+
769
+ /** Set to return the encapsulated content */
770
+ returnEncapsulatedContent?: boolean,
777
771
 
778
772
  /** Whether or not to validate the CAdES sinatures. */
779
773
  validate: boolean,
@@ -868,10 +862,8 @@ export declare class LacunaWebPKI {
868
862
  keyLabel?: string,
869
863
  /** The RSA keys size to be genarated. Be sure that the selected device supports the requested key size on [[TokenModel.mechanisms]]. */
870
864
  keySize: number,
871
-
872
- // TODO: next version
873
- // /** Whether or not to auto enable the used PKCS#11 module after command success. The **default** is `true` */
874
- // enableUsedPkcs11Module?: boolean
865
+ /** Whether or not to auto enable the used PKCS#11 module after command success. The **default** is `true` */
866
+ enableUsedPkcs11Module?: boolean
875
867
 
876
868
  }): Promise<GenerateTokenKeyPairResponse>;
877
869
 
@@ -911,11 +903,8 @@ export declare class LacunaWebPKI {
911
903
  certificateContent: string,
912
904
  /** A label for the imported certificate object in the token. If not set, the same key Id is used. */
913
905
  certificateLabel?: string,
914
-
915
- // TODO: next version
916
- // /** Whether or not to auto enable the used PKCS#11 module after command success. The **default** is `true` */
917
- // enableUsedPkcs11Module?: boolean
918
-
906
+ /** Whether or not to auto enable the used PKCS#11 module after command success. The **default** is `true` */
907
+ enableUsedPkcs11Module?: boolean
919
908
  }): Promise<ImportTokenCertificateResponse>;
920
909
 
921
910
  /**************************************************************
@@ -1053,7 +1042,10 @@ export namespace LacunaWebPKI {
1053
1042
  v1_7_0 = '1.7.0',
1054
1043
  v1_7_2 = '1.7.2',
1055
1044
  v1_8_0 = '1.8.0',
1056
- v1_8_1 = '1.8.1'
1045
+ v1_8_1 = '1.8.1',
1046
+ v1_8_2 = '1.8.2',
1047
+ v1_8_3 = '1.8.3',
1048
+ v1_9_0 = '1.9.0',
1057
1049
  }
1058
1050
 
1059
1051
  /**************************************************************
@@ -1747,40 +1739,35 @@ export interface SignerModel {
1747
1739
 
1748
1740
  export interface CadesSignerModel extends SignerModel {
1749
1741
  messageDigest: DigestModel,
1750
- // TODO: next version
1751
- // signingDescription?: string,
1742
+ signingDescription?: string,
1752
1743
  }
1753
1744
 
1754
1745
  export interface PadesSignerModel extends SignerModel {
1755
1746
  messageDigest: DigestModel,
1756
1747
  isDocumentTimestamp: boolean,
1757
1748
  signatureFieldName: string,
1758
- // TODO: next version
1759
- // reason?: string,
1760
- // location?: string,
1749
+ reason?: string,
1750
+ location?: string,
1761
1751
  }
1762
1752
 
1763
1753
  export interface XmlSignerModel extends SignerModel {
1764
1754
  signatureElementId : string,
1765
1755
  type : LacunaWebPKI.XmlSignedEntityTypes,
1766
1756
  signedElement : XmlElementModel,
1767
- // TODO: next version
1768
- // dataObjectFormat?: DataObjectFormatModel,
1757
+ dataObjectFormat?: DataObjectFormatModel,
1769
1758
  }
1770
1759
 
1771
1760
  export interface CadesSignatureModel {
1772
1761
  encapsulatedContentType: LacunaWebPKI.CmsContentTypes,
1773
1762
  hasEncapsulatedContent: boolean,
1774
- // TODO: next version
1775
- // encapsulatedContent?: string,
1763
+ encapsulatedContent?: string,
1776
1764
  signers: CadesSignerModel[]
1777
1765
  }
1778
1766
 
1779
1767
  export interface PadesSignatureModel {
1780
- // TODO: next version
1781
- // pagesCount: number,
1782
- // pdfAStandard?: LacunaWebPKI.PdfAStandards,
1783
- // metadata?: { [key: string]: string; },
1768
+ pagesCount: number,
1769
+ pdfAStandard?: LacunaWebPKI.PdfAStandards,
1770
+ metadata?: { [key: string]: string; },
1784
1771
  signers: PadesSignerModel[]
1785
1772
  }
1786
1773
 
package/lacuna-web-pki.js CHANGED
@@ -130,15 +130,15 @@ LacunaWebPKI = function (license) {
130
130
  $._edgeExtensionId = 'nedeegdmhlnmboboahchfpkmdnnemapd';
131
131
  $._edgeLegacyProductId = 'd2798a85-9698-425a-add7-3db79a39ca8a';
132
132
  $._chromeExtensionFirstVersionWithSelfUpdate = '2.0.20';
133
- $._jslibVersion = '2.16.2';
133
+ $._jslibVersion = '2.16.4';
134
134
  $._mobileSupported = 'true' === 'true';
135
135
  $._buildChannel = 'stable';
136
136
 
137
137
  // latest components version ----------------------
138
- $._extensionRequiredVersion = '2.16.0';
139
- $._chromeNativeWinRequiredVersion = '2.12.1';
140
- $._chromeNativeLinuxRequiredVersion = '2.13.1';
141
- $._chromeNativeMacRequiredVersion = '2.13.1';
138
+ $._extensionRequiredVersion = '1.0.0';
139
+ $._chromeNativeWinRequiredVersion = '2.12.6';
140
+ $._chromeNativeLinuxRequiredVersion = '2.13.3';
141
+ $._chromeNativeMacRequiredVersion = '2.13.5';
142
142
  $._ieAddonRequiredVersion = '2.9.1';
143
143
  $._mobileRequiredVersion = '3.2.0';
144
144
  // ------------------------------------------------
@@ -192,6 +192,9 @@ LacunaWebPKI = function (license) {
192
192
  v1_7_2: '1.7.2',
193
193
  v1_8_0: '1.8.0',
194
194
  v1_8_1: '1.8.1',
195
+ v1_8_2: '1.8.2',
196
+ v1_8_3: '1.8.3',
197
+ v1_9_0: '1.9.0',
195
198
  latest: 'latest'
196
199
  };
197
200
 
@@ -220,6 +223,9 @@ LacunaWebPKI = function (license) {
220
223
  $._apiMap.nativeWin[$.apiVersions.v1_7_2] = '2.11.0';
221
224
  $._apiMap.nativeWin[$.apiVersions.v1_8_0] = '2.12.0';
222
225
  $._apiMap.nativeWin[$.apiVersions.v1_8_1] = '2.12.1';
226
+ $._apiMap.nativeWin[$.apiVersions.v1_8_2] = '2.12.3';
227
+ $._apiMap.nativeWin[$.apiVersions.v1_8_3] = '2.12.6';
228
+ $._apiMap.nativeWin[$.apiVersions.v1_9_0] = '2.12.3';
223
229
 
224
230
  // IE
225
231
  $._apiMap.ieAddon[$.apiVersions.v1_0] = '2.0.4';
@@ -237,6 +243,9 @@ LacunaWebPKI = function (license) {
237
243
  $._apiMap.ieAddon[$.apiVersions.v1_7_2] = '2.8.0';
238
244
  $._apiMap.ieAddon[$.apiVersions.v1_8_0] = '2.9.0';
239
245
  $._apiMap.ieAddon[$.apiVersions.v1_8_1] = '2.9.1';
246
+ $._apiMap.ieAddon[$.apiVersions.v1_8_2] = '2.9.1';
247
+ $._apiMap.ieAddon[$.apiVersions.v1_8_3] = '2.9.1';
248
+ $._apiMap.ieAddon[$.apiVersions.v1_9_0] = '2.9.1';
240
249
 
241
250
  // Linux
242
251
  $._apiMap.nativeLinux[$.apiVersions.v1_0] = '2.0.0';
@@ -254,6 +263,9 @@ LacunaWebPKI = function (license) {
254
263
  $._apiMap.nativeLinux[$.apiVersions.v1_7_2] = '2.12.1';
255
264
  $._apiMap.nativeLinux[$.apiVersions.v1_8_0] = '2.13.0';
256
265
  $._apiMap.nativeLinux[$.apiVersions.v1_8_1] = '2.13.1';
266
+ $._apiMap.nativeLinux[$.apiVersions.v1_8_2] = '2.13.3';
267
+ $._apiMap.nativeLinux[$.apiVersions.v1_8_3] = '2.13.3';
268
+ $._apiMap.nativeLinux[$.apiVersions.v1_9_0] = '2.13.3';
257
269
 
258
270
  // Mac
259
271
  $._apiMap.nativeMac[$.apiVersions.v1_0] = '2.3.0';
@@ -271,6 +283,9 @@ LacunaWebPKI = function (license) {
271
283
  $._apiMap.nativeMac[$.apiVersions.v1_7_2] = '2.12.1';
272
284
  $._apiMap.nativeMac[$.apiVersions.v1_8_0] = '2.13.0';
273
285
  $._apiMap.nativeMac[$.apiVersions.v1_8_1] = '2.13.1';
286
+ $._apiMap.nativeMac[$.apiVersions.v1_8_2] = '2.13.3';
287
+ $._apiMap.nativeMac[$.apiVersions.v1_8_3] = '2.13.5';
288
+ $._apiMap.nativeMac[$.apiVersions.v1_9_0] = '2.13.3';
274
289
 
275
290
  // WebExtension
276
291
  $._apiMap.extension[$.apiVersions.v1_0] = '2.3.2';
@@ -288,6 +303,9 @@ LacunaWebPKI = function (license) {
288
303
  $._apiMap.extension[$.apiVersions.v1_7_2] = '2.16.0';
289
304
  $._apiMap.extension[$.apiVersions.v1_8_0] = '2.16.0';
290
305
  $._apiMap.extension[$.apiVersions.v1_8_1] = '2.16.0';
306
+ $._apiMap.extension[$.apiVersions.v1_8_2] = '2.16.0';
307
+ $._apiMap.extension[$.apiVersions.v1_8_3] = '2.16.0';
308
+ $._apiMap.extension[$.apiVersions.v1_9_0] = '2.17.0';
291
309
 
292
310
  // Mobile
293
311
  $._apiMap.mobile[$.apiVersions.v1_0] = '1.1.0';
@@ -305,6 +323,9 @@ LacunaWebPKI = function (license) {
305
323
  $._apiMap.mobile[$.apiVersions.v1_7_2] = '3.0.0';
306
324
  $._apiMap.mobile[$.apiVersions.v1_8_0] = '3.2.0';
307
325
  $._apiMap.mobile[$.apiVersions.v1_8_1] = '3.2.0';
326
+ $._apiMap.mobile[$.apiVersions.v1_8_2] = '3.2.0';
327
+ $._apiMap.mobile[$.apiVersions.v1_8_3] = '3.2.0';
328
+ $._apiMap.mobile[$.apiVersions.v1_9_0] = '3.2.0';
308
329
 
309
330
  // All latest
310
331
  $._apiMap.nativeWin [$.apiVersions.latest] = $._chromeNativeWinRequiredVersion;
@@ -1129,16 +1150,15 @@ LacunaWebPKI = function (license) {
1129
1150
  return context.promise;
1130
1151
  };
1131
1152
 
1132
- // TODO: next version
1133
- // $.signHashes = function (args) {
1134
- // var context = this._createContext(args);
1135
- // var request = {
1136
- // certificateThumbprint: args.certificateThumbprint,
1137
- // hashes: args.hashes
1138
- // };
1139
- // $._requestHandler.sendCommand(context, 'signHashes', request);
1140
- // return context.promise;
1141
- // };
1153
+ $.signHashes = function (args) {
1154
+ var context = this._createContext(args);
1155
+ var request = {
1156
+ certificateThumbprint: args.certificateThumbprint,
1157
+ hashes: args.hashes
1158
+ };
1159
+ $._requestHandler.sendCommand(context, 'signHashes', request);
1160
+ return context.promise;
1161
+ };
1142
1162
 
1143
1163
  $.preauthorizeSignatures = function (args) {
1144
1164
 
@@ -1657,6 +1677,7 @@ LacunaWebPKI = function (license) {
1657
1677
  requestId: requestId,
1658
1678
  license: context.license,
1659
1679
  useDomainNativePool: context.useDomainNativePool,
1680
+ jslibVersion: $._jslibVersion,
1660
1681
  command: command,
1661
1682
  request: request
1662
1683
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-pki",
3
- "version": "2.16.2",
3
+ "version": "2.16.4",
4
4
  "description": "The Lacuna Web PKI component enables web applications to interact with digital certificates through javascript, without the need of Java.",
5
5
  "main": "lacuna-web-pki.js",
6
6
  "types": "lacuna-web-pki.d.ts",