web-pki 2.16.1 → 2.17.0-alpha.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.
@@ -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,8 @@ 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_9_0 = '1.9.0',
1056
1046
  }
1057
1047
 
1058
1048
  /**************************************************************
@@ -1746,40 +1736,35 @@ export interface SignerModel {
1746
1736
 
1747
1737
  export interface CadesSignerModel extends SignerModel {
1748
1738
  messageDigest: DigestModel,
1749
- // TODO: next version
1750
- // signingDescription?: string,
1739
+ signingDescription?: string,
1751
1740
  }
1752
1741
 
1753
1742
  export interface PadesSignerModel extends SignerModel {
1754
1743
  messageDigest: DigestModel,
1755
1744
  isDocumentTimestamp: boolean,
1756
1745
  signatureFieldName: string,
1757
- // TODO: next version
1758
- // reason?: string,
1759
- // location?: string,
1746
+ reason?: string,
1747
+ location?: string,
1760
1748
  }
1761
1749
 
1762
1750
  export interface XmlSignerModel extends SignerModel {
1763
1751
  signatureElementId : string,
1764
1752
  type : LacunaWebPKI.XmlSignedEntityTypes,
1765
1753
  signedElement : XmlElementModel,
1766
- // TODO: next version
1767
- // dataObjectFormat?: DataObjectFormatModel,
1754
+ dataObjectFormat?: DataObjectFormatModel,
1768
1755
  }
1769
1756
 
1770
1757
  export interface CadesSignatureModel {
1771
1758
  encapsulatedContentType: LacunaWebPKI.CmsContentTypes,
1772
1759
  hasEncapsulatedContent: boolean,
1773
- // TODO: next version
1774
- // encapsulatedContent?: string,
1760
+ encapsulatedContent?: string,
1775
1761
  signers: CadesSignerModel[]
1776
1762
  }
1777
1763
 
1778
1764
  export interface PadesSignatureModel {
1779
- // TODO: next version
1780
- // pagesCount: number,
1781
- // pdfAStandard?: LacunaWebPKI.PdfAStandards,
1782
- // metadata?: { [key: string]: string; },
1765
+ pagesCount: number,
1766
+ pdfAStandard?: LacunaWebPKI.PdfAStandards,
1767
+ metadata?: { [key: string]: string; },
1783
1768
  signers: PadesSignerModel[]
1784
1769
  }
1785
1770
 
package/lacuna-web-pki.js CHANGED
@@ -130,7 +130,7 @@ 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.17.0-alpha.1';
134
134
  $._mobileSupported = 'true' === 'true';
135
135
  $._buildChannel = 'stable';
136
136
 
@@ -192,6 +192,7 @@ 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_9_0: '1.9.0',
195
196
  latest: 'latest'
196
197
  };
197
198
 
@@ -220,6 +221,7 @@ LacunaWebPKI = function (license) {
220
221
  $._apiMap.nativeWin[$.apiVersions.v1_7_2] = '2.11.0';
221
222
  $._apiMap.nativeWin[$.apiVersions.v1_8_0] = '2.12.0';
222
223
  $._apiMap.nativeWin[$.apiVersions.v1_8_1] = '2.12.1';
224
+ $._apiMap.nativeWin[$.apiVersions.v1_9_0] = '2.12.1';
223
225
 
224
226
  // IE
225
227
  $._apiMap.ieAddon[$.apiVersions.v1_0] = '2.0.4';
@@ -237,6 +239,7 @@ LacunaWebPKI = function (license) {
237
239
  $._apiMap.ieAddon[$.apiVersions.v1_7_2] = '2.8.0';
238
240
  $._apiMap.ieAddon[$.apiVersions.v1_8_0] = '2.9.0';
239
241
  $._apiMap.ieAddon[$.apiVersions.v1_8_1] = '2.9.1';
242
+ $._apiMap.ieAddon[$.apiVersions.v1_9_0] = '2.9.1';
240
243
 
241
244
  // Linux
242
245
  $._apiMap.nativeLinux[$.apiVersions.v1_0] = '2.0.0';
@@ -254,6 +257,7 @@ LacunaWebPKI = function (license) {
254
257
  $._apiMap.nativeLinux[$.apiVersions.v1_7_2] = '2.12.1';
255
258
  $._apiMap.nativeLinux[$.apiVersions.v1_8_0] = '2.13.0';
256
259
  $._apiMap.nativeLinux[$.apiVersions.v1_8_1] = '2.13.1';
260
+ $._apiMap.nativeLinux[$.apiVersions.v1_9_0] = '2.13.1';
257
261
 
258
262
  // Mac
259
263
  $._apiMap.nativeMac[$.apiVersions.v1_0] = '2.3.0';
@@ -271,6 +275,7 @@ LacunaWebPKI = function (license) {
271
275
  $._apiMap.nativeMac[$.apiVersions.v1_7_2] = '2.12.1';
272
276
  $._apiMap.nativeMac[$.apiVersions.v1_8_0] = '2.13.0';
273
277
  $._apiMap.nativeMac[$.apiVersions.v1_8_1] = '2.13.1';
278
+ $._apiMap.nativeMac[$.apiVersions.v1_9_0] = '2.13.1';
274
279
 
275
280
  // WebExtension
276
281
  $._apiMap.extension[$.apiVersions.v1_0] = '2.3.2';
@@ -288,6 +293,7 @@ LacunaWebPKI = function (license) {
288
293
  $._apiMap.extension[$.apiVersions.v1_7_2] = '2.16.0';
289
294
  $._apiMap.extension[$.apiVersions.v1_8_0] = '2.16.0';
290
295
  $._apiMap.extension[$.apiVersions.v1_8_1] = '2.16.0';
296
+ $._apiMap.extension[$.apiVersions.v1_9_0] = '2.17.0';
291
297
 
292
298
  // Mobile
293
299
  $._apiMap.mobile[$.apiVersions.v1_0] = '1.1.0';
@@ -305,6 +311,7 @@ LacunaWebPKI = function (license) {
305
311
  $._apiMap.mobile[$.apiVersions.v1_7_2] = '3.0.0';
306
312
  $._apiMap.mobile[$.apiVersions.v1_8_0] = '3.2.0';
307
313
  $._apiMap.mobile[$.apiVersions.v1_8_1] = '3.2.0';
314
+ $._apiMap.mobile[$.apiVersions.v1_9_0] = '3.2.0';
308
315
 
309
316
  // All latest
310
317
  $._apiMap.nativeWin [$.apiVersions.latest] = $._chromeNativeWinRequiredVersion;
@@ -1129,16 +1136,15 @@ LacunaWebPKI = function (license) {
1129
1136
  return context.promise;
1130
1137
  };
1131
1138
 
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
- // };
1139
+ $.signHashes = function (args) {
1140
+ var context = this._createContext(args);
1141
+ var request = {
1142
+ certificateThumbprint: args.certificateThumbprint,
1143
+ hashes: args.hashes
1144
+ };
1145
+ $._requestHandler.sendCommand(context, 'signHashes', request);
1146
+ return context.promise;
1147
+ };
1142
1148
 
1143
1149
  $.preauthorizeSignatures = function (args) {
1144
1150
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-pki",
3
- "version": "2.16.1",
3
+ "version": "2.17.0-alpha.1",
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",