web-pki 2.16.2 → 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.
- package/lacuna-web-pki.d.ts +68 -82
- package/lacuna-web-pki.js +27 -14
- package/package.json +1 -1
package/lacuna-web-pki.d.ts
CHANGED
|
@@ -324,37 +324,36 @@ export declare class LacunaWebPKI {
|
|
|
324
324
|
usePreauthorizedSignatures?: boolean
|
|
325
325
|
}): Promise<SignHashBatchResponse>;
|
|
326
326
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
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
|
-
|
|
543
|
-
|
|
544
|
-
// reason?: string,
|
|
541
|
+
/** A signing reason */
|
|
542
|
+
reason?: string,
|
|
545
543
|
|
|
546
|
-
|
|
547
|
-
|
|
544
|
+
/** The signing location or address */
|
|
545
|
+
location?: string,
|
|
548
546
|
|
|
549
|
-
|
|
550
|
-
|
|
547
|
+
/** The signer name */
|
|
548
|
+
signerName?: string,
|
|
551
549
|
|
|
552
|
-
|
|
553
|
-
|
|
550
|
+
/** A custom signature field name. Signature field name must be unique for the PDF */
|
|
551
|
+
customSignatureFieldName?: string,
|
|
554
552
|
|
|
555
|
-
|
|
556
|
-
|
|
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
|
-
|
|
602
|
-
|
|
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
|
-
|
|
612
|
-
|
|
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
|
-
|
|
650
|
-
|
|
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
|
-
|
|
709
|
-
|
|
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
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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,9 @@ 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_9_0 = '1.9.0',
|
|
1057
1048
|
}
|
|
1058
1049
|
|
|
1059
1050
|
/**************************************************************
|
|
@@ -1747,40 +1738,35 @@ export interface SignerModel {
|
|
|
1747
1738
|
|
|
1748
1739
|
export interface CadesSignerModel extends SignerModel {
|
|
1749
1740
|
messageDigest: DigestModel,
|
|
1750
|
-
|
|
1751
|
-
// signingDescription?: string,
|
|
1741
|
+
signingDescription?: string,
|
|
1752
1742
|
}
|
|
1753
1743
|
|
|
1754
1744
|
export interface PadesSignerModel extends SignerModel {
|
|
1755
1745
|
messageDigest: DigestModel,
|
|
1756
1746
|
isDocumentTimestamp: boolean,
|
|
1757
1747
|
signatureFieldName: string,
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
// location?: string,
|
|
1748
|
+
reason?: string,
|
|
1749
|
+
location?: string,
|
|
1761
1750
|
}
|
|
1762
1751
|
|
|
1763
1752
|
export interface XmlSignerModel extends SignerModel {
|
|
1764
1753
|
signatureElementId : string,
|
|
1765
1754
|
type : LacunaWebPKI.XmlSignedEntityTypes,
|
|
1766
1755
|
signedElement : XmlElementModel,
|
|
1767
|
-
|
|
1768
|
-
// dataObjectFormat?: DataObjectFormatModel,
|
|
1756
|
+
dataObjectFormat?: DataObjectFormatModel,
|
|
1769
1757
|
}
|
|
1770
1758
|
|
|
1771
1759
|
export interface CadesSignatureModel {
|
|
1772
1760
|
encapsulatedContentType: LacunaWebPKI.CmsContentTypes,
|
|
1773
1761
|
hasEncapsulatedContent: boolean,
|
|
1774
|
-
|
|
1775
|
-
// encapsulatedContent?: string,
|
|
1762
|
+
encapsulatedContent?: string,
|
|
1776
1763
|
signers: CadesSignerModel[]
|
|
1777
1764
|
}
|
|
1778
1765
|
|
|
1779
1766
|
export interface PadesSignatureModel {
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
// metadata?: { [key: string]: string; },
|
|
1767
|
+
pagesCount: number,
|
|
1768
|
+
pdfAStandard?: LacunaWebPKI.PdfAStandards,
|
|
1769
|
+
metadata?: { [key: string]: string; },
|
|
1784
1770
|
signers: PadesSignerModel[]
|
|
1785
1771
|
}
|
|
1786
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.
|
|
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.
|
|
140
|
-
$._chromeNativeLinuxRequiredVersion = '2.13.
|
|
141
|
-
$._chromeNativeMacRequiredVersion = '2.13.
|
|
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
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
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.
|
|
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",
|