web-pki 2.16.1 → 2.16.3

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
  /**************************************************************
@@ -1052,7 +1041,10 @@ export namespace LacunaWebPKI {
1052
1041
  v1_6_1 = '1.6.1',
1053
1042
  v1_7_0 = '1.7.0',
1054
1043
  v1_7_2 = '1.7.2',
1055
- v1_8_0 = '1.8.0'
1044
+ v1_8_0 = '1.8.0',
1045
+ v1_8_1 = '1.8.1',
1046
+ v1_8_2 = '1.8.2',
1047
+ v1_9_0 = '1.9.0',
1056
1048
  }
1057
1049
 
1058
1050
  /**************************************************************
@@ -1746,40 +1738,35 @@ export interface SignerModel {
1746
1738
 
1747
1739
  export interface CadesSignerModel extends SignerModel {
1748
1740
  messageDigest: DigestModel,
1749
- // TODO: next version
1750
- // signingDescription?: string,
1741
+ signingDescription?: string,
1751
1742
  }
1752
1743
 
1753
1744
  export interface PadesSignerModel extends SignerModel {
1754
1745
  messageDigest: DigestModel,
1755
1746
  isDocumentTimestamp: boolean,
1756
1747
  signatureFieldName: string,
1757
- // TODO: next version
1758
- // reason?: string,
1759
- // location?: string,
1748
+ reason?: string,
1749
+ location?: string,
1760
1750
  }
1761
1751
 
1762
1752
  export interface XmlSignerModel extends SignerModel {
1763
1753
  signatureElementId : string,
1764
1754
  type : LacunaWebPKI.XmlSignedEntityTypes,
1765
1755
  signedElement : XmlElementModel,
1766
- // TODO: next version
1767
- // dataObjectFormat?: DataObjectFormatModel,
1756
+ dataObjectFormat?: DataObjectFormatModel,
1768
1757
  }
1769
1758
 
1770
1759
  export interface CadesSignatureModel {
1771
1760
  encapsulatedContentType: LacunaWebPKI.CmsContentTypes,
1772
1761
  hasEncapsulatedContent: boolean,
1773
- // TODO: next version
1774
- // encapsulatedContent?: string,
1762
+ encapsulatedContent?: string,
1775
1763
  signers: CadesSignerModel[]
1776
1764
  }
1777
1765
 
1778
1766
  export interface PadesSignatureModel {
1779
- // TODO: next version
1780
- // pagesCount: number,
1781
- // pdfAStandard?: LacunaWebPKI.PdfAStandards,
1782
- // metadata?: { [key: string]: string; },
1767
+ pagesCount: number,
1768
+ pdfAStandard?: LacunaWebPKI.PdfAStandards,
1769
+ metadata?: { [key: string]: string; },
1783
1770
  signers: PadesSignerModel[]
1784
1771
  }
1785
1772
 
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.1';
133
+ $._jslibVersion = '2.16.3';
134
134
  $._mobileSupported = 'true' === 'true';
135
135
  $._buildChannel = 'stable';
136
136
 
137
137
  // latest components version ----------------------
138
138
  $._extensionRequiredVersion = '2.16.0';
139
- $._chromeNativeWinRequiredVersion = '2.12.1';
140
- $._chromeNativeLinuxRequiredVersion = '2.13.1';
141
- $._chromeNativeMacRequiredVersion = '2.13.1';
139
+ $._chromeNativeWinRequiredVersion = '2.12.3';
140
+ $._chromeNativeLinuxRequiredVersion = '2.13.3';
141
+ $._chromeNativeMacRequiredVersion = '2.13.3';
142
142
  $._ieAddonRequiredVersion = '2.9.1';
143
143
  $._mobileRequiredVersion = '3.2.0';
144
144
  // ------------------------------------------------
@@ -192,6 +192,8 @@ 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_9_0: '1.9.0',
195
197
  latest: 'latest'
196
198
  };
197
199
 
@@ -220,6 +222,8 @@ LacunaWebPKI = function (license) {
220
222
  $._apiMap.nativeWin[$.apiVersions.v1_7_2] = '2.11.0';
221
223
  $._apiMap.nativeWin[$.apiVersions.v1_8_0] = '2.12.0';
222
224
  $._apiMap.nativeWin[$.apiVersions.v1_8_1] = '2.12.1';
225
+ $._apiMap.nativeWin[$.apiVersions.v1_8_2] = '2.12.3';
226
+ $._apiMap.nativeWin[$.apiVersions.v1_9_0] = '2.12.3';
223
227
 
224
228
  // IE
225
229
  $._apiMap.ieAddon[$.apiVersions.v1_0] = '2.0.4';
@@ -237,6 +241,8 @@ LacunaWebPKI = function (license) {
237
241
  $._apiMap.ieAddon[$.apiVersions.v1_7_2] = '2.8.0';
238
242
  $._apiMap.ieAddon[$.apiVersions.v1_8_0] = '2.9.0';
239
243
  $._apiMap.ieAddon[$.apiVersions.v1_8_1] = '2.9.1';
244
+ $._apiMap.ieAddon[$.apiVersions.v1_8_2] = '2.9.1';
245
+ $._apiMap.ieAddon[$.apiVersions.v1_9_0] = '2.9.1';
240
246
 
241
247
  // Linux
242
248
  $._apiMap.nativeLinux[$.apiVersions.v1_0] = '2.0.0';
@@ -254,6 +260,8 @@ LacunaWebPKI = function (license) {
254
260
  $._apiMap.nativeLinux[$.apiVersions.v1_7_2] = '2.12.1';
255
261
  $._apiMap.nativeLinux[$.apiVersions.v1_8_0] = '2.13.0';
256
262
  $._apiMap.nativeLinux[$.apiVersions.v1_8_1] = '2.13.1';
263
+ $._apiMap.nativeLinux[$.apiVersions.v1_8_2] = '2.13.3';
264
+ $._apiMap.nativeLinux[$.apiVersions.v1_9_0] = '2.13.3';
257
265
 
258
266
  // Mac
259
267
  $._apiMap.nativeMac[$.apiVersions.v1_0] = '2.3.0';
@@ -271,6 +279,8 @@ LacunaWebPKI = function (license) {
271
279
  $._apiMap.nativeMac[$.apiVersions.v1_7_2] = '2.12.1';
272
280
  $._apiMap.nativeMac[$.apiVersions.v1_8_0] = '2.13.0';
273
281
  $._apiMap.nativeMac[$.apiVersions.v1_8_1] = '2.13.1';
282
+ $._apiMap.nativeMac[$.apiVersions.v1_8_2] = '2.13.3';
283
+ $._apiMap.nativeMac[$.apiVersions.v1_9_0] = '2.13.3';
274
284
 
275
285
  // WebExtension
276
286
  $._apiMap.extension[$.apiVersions.v1_0] = '2.3.2';
@@ -288,6 +298,8 @@ LacunaWebPKI = function (license) {
288
298
  $._apiMap.extension[$.apiVersions.v1_7_2] = '2.16.0';
289
299
  $._apiMap.extension[$.apiVersions.v1_8_0] = '2.16.0';
290
300
  $._apiMap.extension[$.apiVersions.v1_8_1] = '2.16.0';
301
+ $._apiMap.extension[$.apiVersions.v1_8_2] = '2.16.0';
302
+ $._apiMap.extension[$.apiVersions.v1_9_0] = '2.17.0';
291
303
 
292
304
  // Mobile
293
305
  $._apiMap.mobile[$.apiVersions.v1_0] = '1.1.0';
@@ -305,6 +317,8 @@ LacunaWebPKI = function (license) {
305
317
  $._apiMap.mobile[$.apiVersions.v1_7_2] = '3.0.0';
306
318
  $._apiMap.mobile[$.apiVersions.v1_8_0] = '3.2.0';
307
319
  $._apiMap.mobile[$.apiVersions.v1_8_1] = '3.2.0';
320
+ $._apiMap.mobile[$.apiVersions.v1_8_2] = '3.2.0';
321
+ $._apiMap.mobile[$.apiVersions.v1_9_0] = '3.2.0';
308
322
 
309
323
  // All latest
310
324
  $._apiMap.nativeWin [$.apiVersions.latest] = $._chromeNativeWinRequiredVersion;
@@ -1129,16 +1143,15 @@ LacunaWebPKI = function (license) {
1129
1143
  return context.promise;
1130
1144
  };
1131
1145
 
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
- // };
1146
+ $.signHashes = function (args) {
1147
+ var context = this._createContext(args);
1148
+ var request = {
1149
+ certificateThumbprint: args.certificateThumbprint,
1150
+ hashes: args.hashes
1151
+ };
1152
+ $._requestHandler.sendCommand(context, 'signHashes', request);
1153
+ return context.promise;
1154
+ };
1142
1155
 
1143
1156
  $.preauthorizeSignatures = function (args) {
1144
1157
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-pki",
3
- "version": "2.16.1",
3
+ "version": "2.16.3",
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",