web-pki 2.14.8 → 2.15.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.
@@ -343,7 +343,7 @@ export declare class LacunaWebPKI {
343
343
  /** The digest algorithm identifier of the hashes on `batch` parameter. It can be the algorithm name or OID (i.e. `'SHA-256'` or `'2.16.840.1.101.3.4.2.1'`). */
344
344
  digestAlgorithm: string,
345
345
  /** Set to be able to call [[preauthorizeSignatures]] in order to call [[signHashBatch]] multiple times.*/
346
- usePreauthorizedSignatures: boolean
346
+ usePreauthorizedSignatures?: boolean
347
347
  }): Promise<SignHashBatchResponse>;
348
348
 
349
349
  /**************************************************************
@@ -650,7 +650,7 @@ export declare class LacunaWebPKI {
650
650
  idResolutionTable?: XmlIdResolutionTableModel
651
651
 
652
652
  /** The selected XML [[FileModel.id]], as returned by [[showFileBrowser]] method. */
653
- fileId: string,
653
+ fileId?: string,
654
654
 
655
655
  /** The signer certificate thumbprint. Available in [[CertificateModel.thumbprint]] property returned by [[listCertificates]] method. */
656
656
  certificateThumbprint: string,
@@ -692,7 +692,10 @@ export declare class LacunaWebPKI {
692
692
  */
693
693
  openPades(args: {
694
694
  /** The signed PDF [[FileModel.id]], as returned by [[showFileBrowser]] method. */
695
- signatureFileId: string,
695
+ signatureFileId?: string,
696
+
697
+ /** The signed PDF content (Base64 encoded bytes) to open. It can be passed optionally to `signatureFileId`. */
698
+ signatureContent?: string,
696
699
 
697
700
  /** Whether or not to validate the PDF sinatures. */
698
701
  validate: boolean,
@@ -716,7 +719,10 @@ export declare class LacunaWebPKI {
716
719
  */
717
720
  openCades(args: {
718
721
  /** The signed document (.p7s) [[FileModel.id]], as returned by [[showFileBrowser]] method. */
719
- signatureFileId: string,
722
+ signatureFileId?: string,
723
+
724
+ /** The signed PDF content (Base64 encoded bytes) to open. It can be passed optionally to `signatureFileId`. */
725
+ signatureContent?: string,
720
726
 
721
727
  /** The original file. Only applies if the passed `signatureFileId` does not have the encapsulated content. */
722
728
  originalFileId?: string,
@@ -748,7 +754,7 @@ export declare class LacunaWebPKI {
748
754
  /** The signed XML [[FileModel.id]], as returned by [[showFileBrowser]] method. */
749
755
  signatureFileId?: string,
750
756
 
751
- /** A signed XML content (UTF-8 string or Base64 encoded bytes) can be passed optionally to `signatureFileId`. */
757
+ /** The signed XML content (UTF-8 string or Base64 encoded bytes) to open. It can be passed optionally to `signatureFileId`. */
752
758
  signatureContent?: string,
753
759
 
754
760
  /** Whether or not to validate the CAdES sinatures. */
@@ -1030,6 +1036,11 @@ export namespace LacunaWebPKI {
1030
1036
  Unknown = 'Unknown'
1031
1037
  }
1032
1038
 
1039
+ export const enum CertificatePolicyQualifierTypes {
1040
+ Cps = 'Cps',
1041
+ UserNotice = 'UserNotice'
1042
+ }
1043
+
1033
1044
  export const enum MobileIntegrationModes {
1034
1045
  /** Redirects and continue execution inside Web PKI App. Direct integration without bouncing between Browser App and Web PKI App. */
1035
1046
  AppIntegration = 'appIntegration',
@@ -1055,14 +1066,27 @@ export namespace LacunaWebPKI {
1055
1066
  /** PAdES-BES policy */
1056
1067
  Basic = 'basic',
1057
1068
  /** ICP-Brasil AD-RB policy */
1058
- BrazilAdrBasica = 'brazilAdrBasica'
1069
+ BrazilAdrBasica = 'brazilAdrBasica',
1070
+ PadesT = 'padesT',
1071
+ BrazilAdrTempo = 'brazilAdrTempo'
1059
1072
  }
1060
1073
 
1061
1074
  export const enum CadesPolicies {
1075
+ Cms = 'cms',
1062
1076
  /** CAdES-BES policy */
1063
1077
  Bes = 'cadesBes',
1078
+ /** CAdES-T policy */
1079
+ CadesT = 'cadesT',
1064
1080
  /** ICP-Brasil AD-RB policy */
1065
- BrazilAdrBasica = 'brazilAdrBasica'
1081
+ BrazilAdrBasica = 'brazilAdrBasica',
1082
+ /** ICP-Brasil AD-RT policy */
1083
+ BrazilAdrTempo = 'brazilAdrTempo',
1084
+ /** ICP-Brasil AD-RV policy */
1085
+ BrazilAdrValidacao = 'brazilAdrValidacao',
1086
+ /** ICP-Brasil AD-RC policy */
1087
+ BrazilAdrCompleta = 'brazilAdrCompleta',
1088
+ /** ICP-Brasil AD-RA policy */
1089
+ BrazilAdrArquivamento = 'brazilAdrArquivamento',
1066
1090
  }
1067
1091
 
1068
1092
  export const enum XmlPolicies {
@@ -1071,9 +1095,11 @@ export namespace LacunaWebPKI {
1071
1095
  /** XAdES-BES policy */
1072
1096
  XadesBes = 'xadesBes',
1073
1097
  /** Brazil national NFe policy */
1098
+ XadesT = 'xadesT',
1074
1099
  BrazilNFe = 'brazilNFe',
1075
1100
  /** ICP-Brasil AD-RB policy */
1076
1101
  BrazilAdrBasica = 'brazilAdrBasica',
1102
+ BrazilAdrTempo = 'brazilAdrTempo',
1077
1103
  }
1078
1104
 
1079
1105
  export const enum XmlSignedEntityTypes {
@@ -1255,10 +1281,14 @@ export interface ExceptionModel {
1255
1281
  * Each property on the [[PkiBrazilModel]] and [[PkiItalyModel]] objects may be null, but the objects themselves (`cert.pkiBrazil` or `cert.pkiItaly`) are **never** null.
1256
1282
  */
1257
1283
  export interface CertificateModel {
1258
- /** The Common Name (CN) part of the certificate's subject name field. */
1284
+ /** The Common Name (CN) part of the certificate's subject DN name field. */
1259
1285
  subjectName: string,
1286
+ /** The subject Distinguished Name (DN) formatted string */
1287
+ subjectDN: string,
1260
1288
  /** The Common Name (CN) part of the certificate's issuer name field. */
1261
1289
  issuerName: string,
1290
+ /** The issuer Distinguished Name (DN) formatted string */
1291
+ issuerDN: string,
1262
1292
  /** `true` if the certificate is stored on Web PKI mobile app. `null` or `false` otherwise. */
1263
1293
  isRemote?: boolean,
1264
1294
  /** The subject e-mail address. */
@@ -1267,10 +1297,20 @@ export interface CertificateModel {
1267
1297
  thumbprint: string,
1268
1298
  /** Object with boolean properties indicating wether each possible key usage is set on the certificate. */
1269
1299
  keyUsage: KeyUsagesModel,
1300
+ /** Array with certificate policies info */
1301
+ certificatePolicies: CertificatePolicyModel[],
1270
1302
  /** Object with Brazil-specific fields. */
1271
1303
  pkiBrazil: PkiBrazilModel,
1304
+ /** Object with Argentina-specific fields. */
1305
+ pkiArgentina: PkiArgentinaModel,
1306
+ /** Object with Ecuador-specific fields. */
1307
+ pkiEcuador: PkiEcuadorModel,
1272
1308
  /** Object with Italy-specific fields. */
1273
1309
  pkiItaly: PkiItalyModel,
1310
+ /** Object with Paraguay-specific fields. */
1311
+ pkiParaguay: PkiParaguayModel,
1312
+ /** Object with Peru-specific fields. */
1313
+ pkiPeru: PkiPeruModel,
1274
1314
  /** The not before field of the certificate. */
1275
1315
  validityStart: Date,
1276
1316
  /** The not after field of the certificate. */
@@ -1334,6 +1374,81 @@ export interface PkiItalyModel {
1334
1374
  codiceFiscale: string
1335
1375
  }
1336
1376
 
1377
+ /**************************************************************
1378
+ * Object with PKI Argentina specific fields.
1379
+ */
1380
+ export interface PkiArgentinaModel {
1381
+ /** Clave Única de Identificación Laboral */
1382
+ cuil: string,
1383
+ /** Clave Única de Identificación Tributaria */
1384
+ cuit: string
1385
+ }
1386
+
1387
+ /**************************************************************
1388
+ * Object with PKI Ecuador specific fields.
1389
+ */
1390
+ export interface PkiEcuadorModel {
1391
+ /** */
1392
+ certificateType: string,
1393
+ cedulaDeIdentidad: string,
1394
+ pasaporte: string,
1395
+ /** Registro Único de Proveedores */
1396
+ rup: string,
1397
+ /** Registro Único de Contribuyentes */
1398
+ ruc: string,
1399
+ nombres: string,
1400
+ apellidos: string,
1401
+ razonSocial: string
1402
+ }
1403
+
1404
+ /**************************************************************
1405
+ * Object with PKI Paraguay specific fields.
1406
+ */
1407
+ export interface PkiParaguayModel {
1408
+ personCertificateType: string,
1409
+ certificateType: string,
1410
+ /** Cédula de identidad */
1411
+ ci: string,
1412
+ /** Cédula de identidad para extranjero */
1413
+ cie: string,
1414
+ /** Registro Único de Contribuyente. Número de Cédula Tributaria correspondiente al Titular */
1415
+ ruc: string,
1416
+ pasaporte: string,
1417
+ /** Nombre y apellido del responsable del certificado */
1418
+ responsable: string
1419
+ }
1420
+
1421
+ /**************************************************************
1422
+ * Object with PKI Peru specific fields.
1423
+ */
1424
+ export interface PkiPeruModel {
1425
+ /** Documento Nacional de Identidad */
1426
+ dni: string,
1427
+ /** Registro Único de Contribuyentes */
1428
+ ruc: string
1429
+ }
1430
+
1431
+ /**************************************************************
1432
+ * Object with certificate policy info
1433
+ */
1434
+ export interface CertificatePolicyModel {
1435
+ /** Certificate Policy Identifier */
1436
+ id: string,
1437
+ /** Certificate Policy Qualifiers */
1438
+ qualifiers: CertificatePolicyQualifierModel[]
1439
+ }
1440
+
1441
+ /**************************************************************
1442
+ * Object with certificate policy qualifier
1443
+ */
1444
+ export interface CertificatePolicyQualifierModel {
1445
+ type: LacunaWebPKI.CertificatePolicyQualifierTypes,
1446
+ cpsUri: string,
1447
+ unOrganization: string,
1448
+ unExplicitText: string,
1449
+ unNoticeNumbers: number[],
1450
+ }
1451
+
1337
1452
  // Common Functions
1338
1453
 
1339
1454
  export interface SuccessCallback<T> {
@@ -1740,4 +1855,11 @@ export interface TimestampRequester {
1740
1855
  authentication?: AuthenticationParameters
1741
1856
  }
1742
1857
 
1858
+ export interface GeolocationInfo {
1859
+ accuracy: number,
1860
+ latitude: number,
1861
+ longitude: number,
1862
+ timestamp: Date
1863
+ }
1864
+
1743
1865
 
package/lacuna-web-pki.js CHANGED
@@ -126,11 +126,11 @@ LacunaWebPKI = function (license) {
126
126
 
127
127
  $._installUrl = 'https://get.webpkiplugin.com/';
128
128
  $._chromeExtensionId = 'dcngeagmmhegagicpcmpinaoklddcgon';
129
- $._firefoxExtensionId = 'webpki@lacunasoftware.com';
129
+ $._firefoxExtensionId = 'webpki-beta@lacunasoftware.com';
130
130
  $._edgeExtensionId = 'nedeegdmhlnmboboahchfpkmdnnemapd';
131
131
  $._edgeLegacyProductId = 'd2798a85-9698-425a-add7-3db79a39ca8a';
132
132
  $._chromeExtensionFirstVersionWithSelfUpdate = '2.0.20';
133
- $._jslibVersion = '2.14.8';
133
+ $._jslibVersion = '2.15.0';
134
134
  $._mobileSupported = 'true' === 'true';
135
135
  $._buildChannel = 'stable';
136
136
 
@@ -1325,6 +1325,15 @@ LacunaWebPKI = function (license) {
1325
1325
  return context.promise;
1326
1326
  };
1327
1327
 
1328
+ $.getGeolocation = function (args) {
1329
+ var context = this._createContext(args);
1330
+ var request = {
1331
+ certificateThumbprint: args.certificateThumbprint
1332
+ };
1333
+ $._requestHandler.sendCommand(context, 'getGeolocation', request);
1334
+ return context.promise;
1335
+ };
1336
+
1328
1337
 
1329
1338
  // -------------------- Browser detection --------------------
1330
1339
  // Based on http://stackoverflow.com/questions/2400935/browser-detection-in-javascript
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-pki",
3
- "version": "2.14.8",
3
+ "version": "2.15.0",
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",