@peculiar/certificates-viewer 3.2.1 → 3.3.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.
Files changed (106) hide show
  1. package/dist/cjs/{certification_request-cde57123.js → certification_request-e1997ebf.js} +563 -133
  2. package/dist/cjs/crl-f1ee43bc.js +312 -0
  3. package/dist/cjs/{index-ff818d4d.js → download-a97f4cb2.js} +106 -2
  4. package/dist/cjs/index.cjs.js +1 -3
  5. package/dist/cjs/l10n-638a7577.js +167 -0
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/cjs/{peculiar-attribute-certificate-viewer_2.cjs.entry.js → peculiar-attribute-certificate-viewer_3.cjs.entry.js} +123 -21
  8. package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +25 -15
  9. package/dist/cjs/peculiar-certificate-summary_3.cjs.entry.js +2 -2
  10. package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +6 -25
  11. package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +6 -8
  12. package/dist/cjs/peculiar.cjs.js +1 -1
  13. package/dist/cjs/{public_key-2f5bd471.js → public_key-ba538d77.js} +80 -40
  14. package/dist/cjs/{x509_certificate-51a97033.js → x509_certificate-42b478d2.js} +13 -7
  15. package/dist/collection/collection-manifest.json +1 -0
  16. package/dist/collection/components/certificate-decoder/certificate-decoder.js +19 -6
  17. package/dist/collection/components/certificate-viewer/attributes/type_relationship_attribute.js +2 -1
  18. package/dist/collection/components/certificate-viewer/basic_information.js +3 -1
  19. package/dist/collection/components/certificate-viewer/extensions/basic_constraints_extension.js +2 -1
  20. package/dist/collection/components/certificate-viewer/extensions/basic_extension.js +2 -1
  21. package/dist/collection/components/certificate-viewer/extensions/crl_number_extension.js +19 -0
  22. package/dist/collection/components/certificate-viewer/extensions/index.js +9 -1
  23. package/dist/collection/components/certificate-viewer/extensions/issuing_distribution_point_extension.js +27 -0
  24. package/dist/collection/components/certificate-viewer/extensions/timestamp_extension.js +2 -1
  25. package/dist/collection/components/certificate-viewer/miscellaneous.js +2 -20
  26. package/dist/collection/components/certificates-viewer/certificates-viewer.js +2 -3
  27. package/dist/collection/components/crl-viewer/crl-viewer.js +234 -0
  28. package/dist/collection/components/crl-viewer/revoked_certificates.js +27 -0
  29. package/dist/collection/crypto/crl.js +82 -0
  30. package/dist/collection/crypto/csr.js +7 -0
  31. package/dist/collection/crypto/extension.js +10 -1
  32. package/dist/collection/crypto/index.js +1 -0
  33. package/dist/collection/crypto/x509_attribute_certificate.js +7 -1
  34. package/dist/collection/crypto/x509_certificate.js +7 -1
  35. package/dist/collection/locales/en.json +12 -1
  36. package/dist/collection/utils/download.js +18 -2
  37. package/dist/collection/utils/index.js +1 -0
  38. package/dist/collection/utils/validator.js +2 -0
  39. package/dist/esm/{certification_request-c0674647.js → certification_request-5d982d92.js} +493 -66
  40. package/dist/esm/crl-f2110716.js +308 -0
  41. package/dist/esm/{index-0ba131b0.js → download-67ac9120.js} +102 -2
  42. package/dist/esm/index.js +1 -3
  43. package/dist/esm/{l10n-ac28fa92.js → l10n-da0dd100.js} +24 -2
  44. package/dist/esm/loader.js +1 -1
  45. package/dist/esm/{peculiar-attribute-certificate-viewer_2.entry.js → peculiar-attribute-certificate-viewer_3.entry.js} +113 -12
  46. package/dist/esm/peculiar-certificate-decoder.entry.js +21 -11
  47. package/dist/esm/peculiar-certificate-summary_3.entry.js +2 -2
  48. package/dist/esm/peculiar-certificate-viewer.entry.js +6 -25
  49. package/dist/esm/peculiar-certificates-viewer.entry.js +6 -8
  50. package/dist/esm/peculiar.js +1 -1
  51. package/dist/esm/{public_key-38c9ddc8.js → public_key-0a3091a5.js} +67 -28
  52. package/dist/esm/{x509_certificate-12f6d344.js → x509_certificate-6b243207.js} +9 -3
  53. package/dist/peculiar/index.esm.js +1 -1
  54. package/dist/peculiar/locales/en.json +12 -1
  55. package/dist/peculiar/p-34e2d6be.entry.js +11 -0
  56. package/dist/peculiar/p-35e7a514.js +12 -0
  57. package/dist/peculiar/p-3aea9dde.js +32 -0
  58. package/dist/peculiar/{p-38635919.entry.js → p-49ab6f8c.entry.js} +1 -1
  59. package/dist/peculiar/p-86116b1f.entry.js +4 -0
  60. package/dist/peculiar/{p-464e0943.js → p-bce2bbe0.js} +9 -9
  61. package/dist/peculiar/p-ca0c34ca.entry.js +26 -0
  62. package/dist/peculiar/p-cff9655c.js +18 -0
  63. package/dist/peculiar/{p-17c4da7b.js → p-db6e24c6.js} +2 -2
  64. package/dist/peculiar/p-e535a666.entry.js +4 -0
  65. package/dist/peculiar/p-f8dc3232.js +63 -0
  66. package/dist/peculiar/peculiar.esm.js +1 -1
  67. package/dist/types/components/certificate-decoder/certificate-decoder.d.ts +3 -3
  68. package/dist/types/components/certificate-viewer/basic_information.d.ts +2 -0
  69. package/dist/types/components/certificate-viewer/extensions/crl_number_extension.d.ts +15 -0
  70. package/dist/types/components/certificate-viewer/extensions/issuing_distribution_point_extension.d.ts +15 -0
  71. package/dist/types/components/certificate-viewer/miscellaneous.d.ts +2 -2
  72. package/dist/types/components/certificate-viewer/row.d.ts +1 -1
  73. package/dist/types/components/crl-viewer/crl-viewer.d.ts +59 -0
  74. package/dist/types/components/crl-viewer/revoked_certificates.d.ts +14 -0
  75. package/dist/types/components.d.ts +66 -0
  76. package/dist/types/crypto/crl.d.ts +28 -0
  77. package/dist/types/crypto/csr.d.ts +2 -0
  78. package/dist/types/crypto/extension.d.ts +2 -2
  79. package/dist/types/crypto/index.d.ts +1 -0
  80. package/dist/types/crypto/x509_attribute_certificate.d.ts +2 -0
  81. package/dist/types/crypto/x509_certificate.d.ts +2 -0
  82. package/dist/types/utils/download.d.ts +10 -2
  83. package/dist/types/utils/index.d.ts +1 -0
  84. package/dist/types/utils/l10n.d.ts +11 -0
  85. package/dist/types/utils/validator.d.ts +1 -0
  86. package/package.json +19 -19
  87. package/dist/cjs/_commonjsHelpers-cb1f949a.js +0 -23
  88. package/dist/cjs/csr-78378ed0.js +0 -150
  89. package/dist/cjs/download-6724f3a7.js +0 -79
  90. package/dist/cjs/l10n-a048a686.js +0 -145
  91. package/dist/cjs/x509_attribute_certificate-cc325b70.js +0 -87
  92. package/dist/esm/_commonjsHelpers-bfbd2ad8.js +0 -20
  93. package/dist/esm/csr-c1b6a176.js +0 -147
  94. package/dist/esm/download-735fb2eb.js +0 -76
  95. package/dist/esm/x509_attribute_certificate-a6d4aa15.js +0 -85
  96. package/dist/peculiar/p-006865d7.js +0 -4
  97. package/dist/peculiar/p-3f8d1008.entry.js +0 -4
  98. package/dist/peculiar/p-42da7f97.js +0 -11
  99. package/dist/peculiar/p-4f4c1d30.js +0 -12
  100. package/dist/peculiar/p-6011646e.entry.js +0 -11
  101. package/dist/peculiar/p-6bfd077c.entry.js +0 -18
  102. package/dist/peculiar/p-6c510523.js +0 -18
  103. package/dist/peculiar/p-986cc770.entry.js +0 -11
  104. package/dist/peculiar/p-b765873e.js +0 -78
  105. package/dist/peculiar/p-d0b55fbb.js +0 -4
  106. package/dist/peculiar/p-d7a13cb4.js +0 -18
@@ -4,11 +4,9 @@
4
4
  'use strict';
5
5
 
6
6
  const index = require('./index-064e95c7.js');
7
- const index$1 = require('./index-ff818d4d.js');
8
- const l10n = require('./l10n-a048a686.js');
9
- const certification_request = require('./certification_request-cde57123.js');
10
- const csr = require('./csr-78378ed0.js');
11
- const download = require('./download-6724f3a7.js');
7
+ const download = require('./download-a97f4cb2.js');
8
+ const l10n = require('./l10n-638a7577.js');
9
+ const certification_request = require('./certification_request-e1997ebf.js');
12
10
 
13
11
  /**
14
12
  * @license
@@ -95,7 +93,7 @@ const Signature = (props) => {
95
93
  return [
96
94
  index.h(RowTitle, { value: l10n.l10n.getString('signature') }),
97
95
  index.h(RowValue, { name: l10n.l10n.getString('algorithm'), value: getStringByOID(signature.algorithm) }),
98
- index.h(RowValue, { name: l10n.l10n.getString('value'), value: index$1.build.Convert.ToHex(signature.value), monospace: true, collapse: true }),
96
+ index.h(RowValue, { name: l10n.l10n.getString('value'), value: download.build.Convert.ToHex(signature.value), monospace: true, collapse: true }),
99
97
  ];
100
98
  };
101
99
 
@@ -147,13 +145,13 @@ const GeneralNamePart = (props) => {
147
145
  catch (error) {
148
146
  //
149
147
  }
150
- return (index.h(RowValue, { name: certification_request.OIDs[value.typeId] || value.typeId, value: index$1.build.Convert.ToHex(value.value), monospace: true }));
148
+ return (index.h(RowValue, { name: certification_request.OIDs[value.typeId] || value.typeId, value: download.build.Convert.ToHex(value.value), monospace: true }));
151
149
  }
152
- if (index$1.build.BufferSourceConverter.isBufferSource(value)) {
153
- return (index.h(RowValue, { name: names[name] || name, value: index$1.build.Convert.ToString(value) }));
150
+ if (download.build.BufferSourceConverter.isBufferSource(value)) {
151
+ return (index.h(RowValue, { name: names[name] || name, value: download.build.Convert.ToString(value) }));
154
152
  }
155
153
  if (value instanceof certification_request.EDIPartyName) {
156
- return (index.h(RowValue, { name: names[name] || name, value: index$1.build.Convert.ToString(value.partyName) }));
154
+ return (index.h(RowValue, { name: names[name] || name, value: download.build.Convert.ToString(value.partyName) }));
157
155
  }
158
156
  if (name === 'dNSName') {
159
157
  return (index.h(RowValue, { name: names[name] || name, value: value, href: getDNSNameLink(value) }));
@@ -198,7 +196,7 @@ const BasicExtension = (props, children) => {
198
196
  const { extension } = props;
199
197
  return ([
200
198
  index.h(RowValue, { name: "Name", value: getStringByOID(extension.asn.extnID) }),
201
- index.h(RowValue, { name: "Critical", value: extension.asn.critical ? 'Yes' : 'No' }),
199
+ index.h(RowValue, { name: "Critical", value: extension.asn.critical ? l10n.l10n.getString('yes') : l10n.l10n.getString('no') }),
202
200
  children,
203
201
  index.h("tr", null,
204
202
  index.h("td", { colSpan: 2, class: "divider" },
@@ -229,7 +227,7 @@ const KeyUsageExtension = (props) => {
229
227
  const BasicConstraintsExtension = (props) => {
230
228
  const { extension } = props;
231
229
  return (index.h(BasicExtension, { extension: extension },
232
- index.h(RowValue, { name: "Certificate Authority", value: extension.value.cA ? 'Yes' : 'No' }),
230
+ index.h(RowValue, { name: "Certificate Authority", value: extension.value.cA ? l10n.l10n.getString('yes') : l10n.l10n.getString('no') }),
233
231
  index.h(RowValue, { name: "Path Length Constraint", value: extension.value.pathLenConstraint })));
234
232
  };
235
233
 
@@ -254,7 +252,7 @@ const ExtendedKeyUsageExtension = (props) => {
254
252
  */
255
253
  const SubjectKeyIdentifierExtension = (props) => {
256
254
  const { extension, getSubjectKeyIdChildrenLink, getSubjectKeyIdSiblingsLink } = props;
257
- const keyId = index$1.build.Convert.ToHex(extension.value.buffer);
255
+ const keyId = download.build.Convert.ToHex(extension.value.buffer);
258
256
  const childrenLink = getSubjectKeyIdChildrenLink(keyId);
259
257
  const siblingsLink = getSubjectKeyIdSiblingsLink(keyId);
260
258
  return (index.h(BasicExtension, { extension: extension },
@@ -279,7 +277,7 @@ const SubjectKeyIdentifierExtension = (props) => {
279
277
  */
280
278
  const AuthorityKeyIdentifierExtension = (props) => {
281
279
  const { extension, getAuthKeyIdParentLink, getAuthKeyIdSiblingsLink } = props;
282
- const keyId = index$1.build.Convert.ToHex(extension.value.keyIdentifier.buffer);
280
+ const keyId = download.build.Convert.ToHex(extension.value.keyIdentifier.buffer);
283
281
  const parentLink = getAuthKeyIdParentLink(keyId);
284
282
  const siblingsLink = getAuthKeyIdSiblingsLink(keyId);
285
283
  return (index.h(BasicExtension, { extension: extension },
@@ -552,7 +550,7 @@ const QCStatementsExtension = (props) => {
552
550
  return (index.h(BasicExtension, { extension: extension }, extension.value.map((statement, arrayIndex) => ([
553
551
  index.h(RowValue, { name: `Statement #${arrayIndex + 1}`, value: "" }),
554
552
  index.h(RowValue, { name: "ID", value: getStringByOID(statement.statementId) }),
555
- index.h(RowValue, { name: "Info", value: statement.statementInfo.byteLength ? index$1.build.Convert.ToHex(statement.statementInfo) : null, monospace: true }),
553
+ index.h(RowValue, { name: "Info", value: statement.statementInfo.byteLength ? download.build.Convert.ToHex(statement.statementInfo) : null, monospace: true }),
556
554
  ]))));
557
555
  };
558
556
 
@@ -620,7 +618,7 @@ const TimestampExtension = (props) => {
620
618
  return (index.h(BasicExtension, { extension: extension },
621
619
  index.h(RowValue, { name: "Version", value: extension.value.version }),
622
620
  index.h(GeneralNamePart, Object.assign({ generalName: extension.value.location }, props)),
623
- index.h(RowValue, { name: "Requires Auth", value: extension.value.requiresAuth ? 'Yes' : 'No' })));
621
+ index.h(RowValue, { name: "Requires Auth", value: extension.value.requiresAuth ? l10n.l10n.getString('yes') : l10n.l10n.getString('no') })));
624
622
  };
625
623
 
626
624
  /**
@@ -657,7 +655,7 @@ const CRLReasonExtension = (props) => {
657
655
  * LICENSE file in the root directory of this source tree.
658
656
  */
659
657
  function getAttributeValue(attribute) {
660
- return index$1.build.Convert.ToString(attribute.values[0]);
658
+ return download.build.Convert.ToString(attribute.values[0]);
661
659
  }
662
660
 
663
661
  /**
@@ -731,7 +729,7 @@ const BiometricSyntaxExtension = (props) => {
731
729
  index.h(RowValue, { name: "OID", value: getStringByOID(data.typeOfBiometricData.biometricDataOid) }),
732
730
  index.h(RowValue, { name: "Type", value: data.typeOfBiometricData.predefinedBiometricType }),
733
731
  index.h(RowValue, { name: "Algorithm", value: getStringByOID(data.hashAlgorithm.algorithm) }),
734
- index.h(RowValue, { name: "Hash", value: index$1.build.Convert.ToHex(data.biometricDataHash.buffer), monospace: true }),
732
+ index.h(RowValue, { name: "Hash", value: download.build.Convert.ToHex(data.biometricDataHash.buffer), monospace: true }),
735
733
  index.h(RowValue, { name: "Source Uri", value: data.sourceDataUri }),
736
734
  ]))));
737
735
  };
@@ -753,7 +751,7 @@ const LogotypeExtension = (props) => {
753
751
  const { imageDetails } = img;
754
752
  return [
755
753
  index.h(RowValue, { name: "Image Type", value: imageDetails.mediaType }),
756
- index.h(RowValue, { name: "Image Hash", value: index$1.build.Convert.ToHex(imageDetails.logotypeHash[0].hashValue), monospace: true }),
754
+ index.h(RowValue, { name: "Image Hash", value: download.build.Convert.ToHex(imageDetails.logotypeHash[0].hashValue), monospace: true }),
757
755
  index.h(RowValue, { name: "Image URL", value: imageDetails.logotypeURI[0], monospace: true, collapse: true }),
758
756
  index.h(RowValue, { name: "Image Hash Algorithm", value: getStringByOID(imageDetails.logotypeHash[0].hashAlg.algorithm) }),
759
757
  ];
@@ -767,7 +765,7 @@ const LogotypeExtension = (props) => {
767
765
  const { audioDetails } = aud;
768
766
  return [
769
767
  index.h(RowValue, { name: "Audio Type", value: audioDetails.mediaType }),
770
- index.h(RowValue, { name: "Audio Hash", value: index$1.build.Convert.ToHex(audioDetails.logotypeHash[0].hashValue), monospace: true }),
768
+ index.h(RowValue, { name: "Audio Hash", value: download.build.Convert.ToHex(audioDetails.logotypeHash[0].hashValue), monospace: true }),
771
769
  index.h(RowValue, { name: "Audio URL", value: audioDetails.logotypeURI[0], monospace: true, collapse: true }),
772
770
  index.h(RowValue, { name: "Audio Hash Algorithm", value: getStringByOID(audioDetails.logotypeHash[0].hashAlg.algorithm) }),
773
771
  ];
@@ -839,6 +837,39 @@ const PolicyMappingsExtension = (props) => {
839
837
  ]))));
840
838
  };
841
839
 
840
+ /**
841
+ * @license
842
+ * Copyright (c) Peculiar Ventures, LLC.
843
+ *
844
+ * This source code is licensed under the MIT license found in the
845
+ * LICENSE file in the root directory of this source tree.
846
+ */
847
+ const CRLNumberExtension = (props) => {
848
+ const { extension } = props;
849
+ return (index.h(BasicExtension, { extension: extension },
850
+ index.h(RowValue, { name: l10n.l10n.getString('value'), value: extension.value.value })));
851
+ };
852
+
853
+ /**
854
+ * @license
855
+ * Copyright (c) Peculiar Ventures, LLC.
856
+ *
857
+ * This source code is licensed under the MIT license found in the
858
+ * LICENSE file in the root directory of this source tree.
859
+ */
860
+ // eslint-disable-next-line max-len
861
+ const IssuingDistributionPointExtension = (props) => {
862
+ var _a;
863
+ const { extension } = props;
864
+ return (index.h(BasicExtension, { extension: extension }, (_a = extension.value.distributionPoint) === null || _a === void 0 ? void 0 :
865
+ _a.fullName.map((gn) => (index.h(GeneralNamePart, Object.assign({ generalName: gn }, props)))),
866
+ extension.value.onlySomeReasons && (index.h(RowValue, { name: l10n.l10n.getString('onlyReasons'), value: extension.value.onlySomeReasons.toJSON().join(', ') })),
867
+ extension.value.indirectCRL && (index.h(RowValue, { name: l10n.l10n.getString('indirectCRL'), value: l10n.l10n.getString('yes') })),
868
+ extension.value.onlyContainsUserCerts && (index.h(RowValue, { name: l10n.l10n.getString('onlyUserCertificates'), value: l10n.l10n.getString('yes') })),
869
+ extension.value.onlyContainsAttributeCerts && (index.h(RowValue, { name: l10n.l10n.getString('onlyAttributeCertificates'), value: l10n.l10n.getString('yes') })),
870
+ extension.value.onlyContainsCACerts && (index.h(RowValue, { name: l10n.l10n.getString('onlyCACertificates'), value: l10n.l10n.getString('yes') }))));
871
+ };
872
+
842
873
  /**
843
874
  * @license
844
875
  * Copyright (c) Peculiar Ventures, LLC.
@@ -946,6 +977,12 @@ const Extensions = (props) => {
946
977
  if (extension.value instanceof certification_request.PolicyMappings) {
947
978
  return (index.h(PolicyMappingsExtension, { extension: extension }));
948
979
  }
980
+ if (extension.value instanceof certification_request.CRLNumber) {
981
+ return (index.h(CRLNumberExtension, { extension: extension }));
982
+ }
983
+ if (extension.value instanceof certification_request.IssuingDistributionPoint) {
984
+ return (index.h(IssuingDistributionPointExtension, Object.assign({ extension: extension }, props)));
985
+ }
949
986
  if (typeof extension.value === 'string') {
950
987
  return (index.h(AsStringExtension, { extension: extension }));
951
988
  }
@@ -967,7 +1004,7 @@ const Extensions = (props) => {
967
1004
  * LICENSE file in the root directory of this source tree.
968
1005
  */
969
1006
  const BasicInformation = (props) => {
970
- const { serialNumber, version, validity, notBefore, notAfter, type, } = props;
1007
+ const { serialNumber, version, validity, notBefore, notAfter, lastUpdate, nextUpdate, type, } = props;
971
1008
  return [
972
1009
  index.h(RowTitle, { value: l10n.l10n.getString('basicInformation') }),
973
1010
  index.h(RowValue, { name: l10n.l10n.getString('type'), value: type }),
@@ -976,6 +1013,8 @@ const BasicInformation = (props) => {
976
1013
  index.h(RowValue, { name: l10n.l10n.getString('validity'), value: validity }),
977
1014
  index.h(RowValue, { name: l10n.l10n.getString('issued'), value: notBefore ? l10n.dateShort(notBefore) : undefined }),
978
1015
  index.h(RowValue, { name: l10n.l10n.getString('expired'), value: notAfter ? l10n.dateShort(notAfter) : undefined }),
1016
+ index.h(RowValue, { name: l10n.l10n.getString('lastUpdate'), value: lastUpdate ? l10n.dateShort(lastUpdate) : undefined }),
1017
+ index.h(RowValue, { name: l10n.l10n.getString('nextUpdate'), value: nextUpdate ? l10n.dateShort(nextUpdate) : undefined }),
979
1018
  ];
980
1019
  };
981
1020
 
@@ -986,22 +1025,6 @@ const BasicInformation = (props) => {
986
1025
  * This source code is licensed under the MIT license found in the
987
1026
  * LICENSE file in the root directory of this source tree.
988
1027
  */
989
- function downloadCertificateAsPem(certificate) {
990
- if (certificate instanceof csr.CSR) {
991
- download.Download.pkcs10.asPEM(certificate.exportAsPemFormatted(), certificate.commonName);
992
- }
993
- else {
994
- download.Download.x509.asPEM(certificate.exportAsPemFormatted(), certificate.commonName);
995
- }
996
- }
997
- function downloadCertificateAsDer(certificate) {
998
- if (certificate instanceof csr.CSR) {
999
- download.Download.pkcs10.asDER(certificate.exportAsHexFormatted(), certificate.commonName);
1000
- }
1001
- else {
1002
- download.Download.x509.asDER(certificate.exportAsHexFormatted(), certificate.commonName);
1003
- }
1004
- }
1005
1028
  const Miscellaneous = (props) => {
1006
1029
  const { certificate } = props;
1007
1030
  return [
@@ -1012,9 +1035,9 @@ const Miscellaneous = (props) => {
1012
1035
  l10n.l10n.getString('download'),
1013
1036
  ":")),
1014
1037
  index.h("td", null,
1015
- index.h("peculiar-button-split", { onClick: downloadCertificateAsPem.bind(undefined, certificate), actions: [{
1038
+ index.h("peculiar-button-split", { onClick: () => certificate.downloadAsPEM(), actions: [{
1016
1039
  text: l10n.l10n.getString('download.der'),
1017
- onClick: downloadCertificateAsDer.bind(undefined, certificate),
1040
+ onClick: () => certificate.downloadAsDER(),
1018
1041
  }] }, l10n.l10n.getString('download.pem')))),
1019
1042
  ];
1020
1043
  };
@@ -1030,6 +1053,22 @@ const getLEILink = (lei) => `https://search.gleif.org/#/record/${lei}`;
1030
1053
  const getDNSNameLink = (dnsName) => `https://search.censys.io/search?resource=hosts&q=dns.names%3A${dnsName}`;
1031
1054
  const getIPAddressLink = (ipAddress) => `https://search.censys.io/search?resource=hosts&q=ip%3A${ipAddress}`;
1032
1055
 
1056
+ /**
1057
+ * @license
1058
+ * Copyright (c) Peculiar Ventures, LLC.
1059
+ *
1060
+ * This source code is licensed under the MIT license found in the
1061
+ * LICENSE file in the root directory of this source tree.
1062
+ */
1063
+ const IssuerName = (props) => {
1064
+ const { name, issuerDnLink } = props;
1065
+ const title = l10n.l10n.getString('issuerName');
1066
+ return [
1067
+ index.h(RowTitle, { value: issuerDnLink ? (index.h("peculiar-link", { href: issuerDnLink, type: "h6" }, title)) : title }),
1068
+ name.map((n) => (index.h(RowValue, { name: n.name || n.type, value: n.value }))),
1069
+ ];
1070
+ };
1071
+
1033
1072
  /**
1034
1073
  * @license
1035
1074
  * Copyright (c) Peculiar Ventures, LLC.
@@ -1084,13 +1123,14 @@ const PublicKey = (props) => {
1084
1123
  index.h(RowValue, { name: l10n.l10n.getString('namedCurve'), value: getStringByOID((_a = publicKey.params) === null || _a === void 0 ? void 0 : _a['namedCurve']) }),
1085
1124
  index.h(RowValue, { name: l10n.l10n.getString('exponent'), value: getPublicKeyExponent(publicKey) }),
1086
1125
  index.h(RowValue, { name: l10n.l10n.getString('modulus'), value: getPublicKeyModulus(publicKey) }),
1087
- index.h(RowValue, { name: l10n.l10n.getString('value'), value: index$1.build.Convert.ToHex(publicKey.value), monospace: true, collapse: true }),
1126
+ index.h(RowValue, { name: l10n.l10n.getString('value'), value: download.build.Convert.ToHex(publicKey.value), monospace: true, collapse: true }),
1088
1127
  ];
1089
1128
  };
1090
1129
 
1091
1130
  exports.BasicInformation = BasicInformation;
1092
1131
  exports.Extensions = Extensions;
1093
1132
  exports.GeneralNamePart = GeneralNamePart;
1133
+ exports.IssuerName = IssuerName;
1094
1134
  exports.Miscellaneous = Miscellaneous;
1095
1135
  exports.PublicKey = PublicKey;
1096
1136
  exports.RowTitle = RowTitle;
@@ -3,9 +3,9 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- const certification_request = require('./certification_request-cde57123.js');
7
- const index = require('./index-ff818d4d.js');
8
- const l10n = require('./l10n-a048a686.js');
6
+ const certification_request = require('./certification_request-e1997ebf.js');
7
+ const download = require('./download-a97f4cb2.js');
8
+ const l10n = require('./l10n-638a7577.js');
9
9
 
10
10
  /**
11
11
  * @license
@@ -20,7 +20,7 @@ class X509Certificate extends certification_request.AsnData {
20
20
  this.thumbprints = {};
21
21
  this.type = 'X.509 Certificate';
22
22
  const { tbsCertificate } = this.asn;
23
- this.serialNumber = index.build.Convert.ToHex(tbsCertificate.serialNumber);
23
+ this.serialNumber = download.build.Convert.ToHex(tbsCertificate.serialNumber);
24
24
  this.subject = new certification_request.Name(tbsCertificate.subject).toJSON();
25
25
  this.issuer = new certification_request.Name(tbsCertificate.issuer).toJSON();
26
26
  this.version = tbsCertificate.version + 1;
@@ -69,10 +69,10 @@ class X509Certificate extends certification_request.AsnData {
69
69
  };
70
70
  }
71
71
  exportAsBase64() {
72
- return index.build.Convert.ToBase64(this.raw);
72
+ return download.build.Convert.ToBase64(this.raw);
73
73
  }
74
74
  exportAsHexFormatted() {
75
- return certification_request.hexFormat(index.build.Convert.ToHex(this.raw));
75
+ return certification_request.hexFormat(download.build.Convert.ToHex(this.raw));
76
76
  }
77
77
  exportAsPemFormatted() {
78
78
  return `-----BEGIN CERTIFICATE-----\n${certification_request.base64Format(this.exportAsBase64())}\n-----END CERTIFICATE-----`;
@@ -81,7 +81,7 @@ class X509Certificate extends certification_request.AsnData {
81
81
  try {
82
82
  const thumbprint = await certification_request.getCertificateThumbprint(algorithm, this.raw);
83
83
  if (thumbprint) {
84
- this.thumbprints[algorithm['name'] || algorithm] = index.build.Convert.ToHex(thumbprint);
84
+ this.thumbprints[algorithm['name'] || algorithm] = download.build.Convert.ToHex(thumbprint);
85
85
  }
86
86
  }
87
87
  catch (error) {
@@ -134,6 +134,12 @@ class X509Certificate extends certification_request.AsnData {
134
134
  .map((name) => (`${name.shortName}=${name.value}`))
135
135
  .join(', ');
136
136
  }
137
+ downloadAsPEM(name) {
138
+ download.Download.cert.asPEM(this.exportAsPemFormatted(), name || this.commonName);
139
+ }
140
+ downloadAsDER(name) {
141
+ download.Download.cert.asDER(this.exportAsHexFormatted(), name || this.commonName);
142
+ }
137
143
  }
138
144
 
139
145
  exports.X509Certificate = X509Certificate;
@@ -4,6 +4,7 @@
4
4
  "./components/button-split/button-split.js",
5
5
  "./components/certificate-viewer/certificate-viewer.js",
6
6
  "./components/certificates-viewer/certificates-viewer.js",
7
+ "./components/crl-viewer/crl-viewer.js",
7
8
  "./components/csr-viewer/csr-viewer.js",
8
9
  "./components/button/button.js",
9
10
  "./components/certificate-decoder/certificate-decoder.js",
@@ -10,7 +10,7 @@
10
10
  */
11
11
  import { Component, Host, h, State, Prop, Event, } from '@stencil/core';
12
12
  import { validator, readAsBinaryString } from '../../utils';
13
- import { X509Certificate, X509AttributeCertificate, CSR } from '../../crypto';
13
+ import { X509Certificate, X509AttributeCertificate, CSR, CRL, } from '../../crypto';
14
14
  export class CertificateDecoder {
15
15
  constructor() {
16
16
  this.onClickDecode = () => {
@@ -70,11 +70,12 @@ export class CertificateDecoder {
70
70
  const isX509Pem = validator.isX509Pem(certificate);
71
71
  const isPkcs10Pem = validator.isPkcs10Pem(certificate);
72
72
  const isX509AttributePem = validator.isX509AttributePem(certificate);
73
+ const isX509CRLPem = validator.isX509CRLPem(certificate);
73
74
  let decoded;
74
75
  let decodeError;
75
- if (isPem && !(isX509Pem || isX509AttributePem || isPkcs10Pem)) {
76
+ if (isPem && !(isX509Pem || isX509AttributePem || isPkcs10Pem || isX509CRLPem)) {
76
77
  this.clearValue();
77
- alert('Unsupported file type. Please try to use Certificate/AttributeCertificate/CertificateRequest.');
78
+ alert('Unsupported file type. Please try to use Certificate/AttributeCertificate/CertificateRequest/CRL.');
78
79
  return;
79
80
  }
80
81
  try {
@@ -87,6 +88,9 @@ export class CertificateDecoder {
87
88
  if (isPkcs10Pem) {
88
89
  decoded = new CSR(certificate);
89
90
  }
91
+ if (isX509CRLPem) {
92
+ decoded = new CRL(certificate);
93
+ }
90
94
  }
91
95
  catch (error) {
92
96
  decodeError = error;
@@ -115,10 +119,18 @@ export class CertificateDecoder {
115
119
  decodeError = error;
116
120
  }
117
121
  }
122
+ if (!decoded) {
123
+ try {
124
+ decoded = new CRL(certificate);
125
+ }
126
+ catch (error) {
127
+ decodeError = error;
128
+ }
129
+ }
118
130
  if (!decoded) {
119
131
  this.clearValue();
120
132
  console.log(decodeError);
121
- alert('Error decoding file. Please try to use Certificate/AttributeCertificate/CertificateRequest.');
133
+ alert('Error decoding file. Please try to use Certificate/AttributeCertificate/CertificateRequest/CRL.');
122
134
  }
123
135
  else {
124
136
  this.setValue(decoded);
@@ -131,12 +143,13 @@ export class CertificateDecoder {
131
143
  h("peculiar-button", { fill: "fill", class: "button", onClick: this.onClickDecode }, "Decode"),
132
144
  h("peculiar-button", { class: "button" },
133
145
  "Choose file",
134
- h("input", { type: "file", class: "input_file", accept: "application/pkix-cert,application/x-x509-ca-cert,application/x-x509-user-cert,application/pkcs10,.csr,.req", onChange: this.onChangeInputFile, value: "" })),
146
+ h("input", { type: "file", class: "input_file", accept: "application/pkix-cert,application/x-x509-ca-cert,application/x-x509-user-cert,application/pkcs10,application/pkix-crl,.csr,.req,.crl", onChange: this.onChangeInputFile, value: "" })),
135
147
  h("peculiar-button", { class: "button", onClick: this.onClickClear }, "Clear"),
136
148
  this.certificateExample && (h("peculiar-button", { class: "button", onClick: this.onClickExample }, "Example"))),
137
149
  this.certificateDecoded instanceof X509Certificate && (h("peculiar-certificate-viewer", { certificate: this.certificateDecoded, class: "viewer", download: true })),
138
150
  this.certificateDecoded instanceof X509AttributeCertificate && (h("peculiar-attribute-certificate-viewer", { certificate: this.certificateDecoded, class: "viewer", download: true })),
139
- this.certificateDecoded instanceof CSR && (h("peculiar-csr-viewer", { certificate: this.certificateDecoded, class: "viewer", download: true }))));
151
+ this.certificateDecoded instanceof CSR && (h("peculiar-csr-viewer", { certificate: this.certificateDecoded, class: "viewer", download: true })),
152
+ this.certificateDecoded instanceof CRL && (h("peculiar-crl-viewer", { certificate: this.certificateDecoded, class: "viewer", download: true }))));
140
153
  }
141
154
  static get is() { return "peculiar-certificate-decoder"; }
142
155
  static get encapsulation() { return "shadow"; }
@@ -10,8 +10,9 @@
10
10
  */
11
11
  import { h } from '@stencil/core';
12
12
  import { BasicAttribute } from './basic_attribute';
13
+ import { l10n } from '../../../utils';
13
14
  import { RowValue } from '../row';
14
15
  export const TypeRelationshipAttribute = (props) => {
15
16
  const { attribute } = props;
16
- return (h(BasicAttribute, { attribute: attribute }, Object.keys(attribute.value).map((keyName) => (h(RowValue, { name: keyName, value: attribute.value[keyName].toNumber() ? 'Yes' : 'No' })))));
17
+ return (h(BasicAttribute, { attribute: attribute }, Object.keys(attribute.value).map((keyName) => (h(RowValue, { name: keyName, value: attribute.value[keyName].toNumber() ? l10n.getString('yes') : l10n.getString('no') })))));
17
18
  };
@@ -12,7 +12,7 @@ import { h } from '@stencil/core';
12
12
  import { dateShort, l10n } from '../../utils';
13
13
  import { RowTitle, RowValue } from './row';
14
14
  export const BasicInformation = (props) => {
15
- const { serialNumber, version, validity, notBefore, notAfter, type, } = props;
15
+ const { serialNumber, version, validity, notBefore, notAfter, lastUpdate, nextUpdate, type, } = props;
16
16
  return [
17
17
  h(RowTitle, { value: l10n.getString('basicInformation') }),
18
18
  h(RowValue, { name: l10n.getString('type'), value: type }),
@@ -21,5 +21,7 @@ export const BasicInformation = (props) => {
21
21
  h(RowValue, { name: l10n.getString('validity'), value: validity }),
22
22
  h(RowValue, { name: l10n.getString('issued'), value: notBefore ? dateShort(notBefore) : undefined }),
23
23
  h(RowValue, { name: l10n.getString('expired'), value: notAfter ? dateShort(notAfter) : undefined }),
24
+ h(RowValue, { name: l10n.getString('lastUpdate'), value: lastUpdate ? dateShort(lastUpdate) : undefined }),
25
+ h(RowValue, { name: l10n.getString('nextUpdate'), value: nextUpdate ? dateShort(nextUpdate) : undefined }),
24
26
  ];
25
27
  };
@@ -10,10 +10,11 @@
10
10
  */
11
11
  import { h } from '@stencil/core';
12
12
  import { RowValue } from '../row';
13
+ import { l10n } from '../../../utils';
13
14
  import { BasicExtension } from './basic_extension';
14
15
  export const BasicConstraintsExtension = (props) => {
15
16
  const { extension } = props;
16
17
  return (h(BasicExtension, { extension: extension },
17
- h(RowValue, { name: "Certificate Authority", value: extension.value.cA ? 'Yes' : 'No' }),
18
+ h(RowValue, { name: "Certificate Authority", value: extension.value.cA ? l10n.getString('yes') : l10n.getString('no') }),
18
19
  h(RowValue, { name: "Path Length Constraint", value: extension.value.pathLenConstraint })));
19
20
  };
@@ -11,11 +11,12 @@
11
11
  import { h } from '@stencil/core';
12
12
  import { getStringByOID } from '../get_string_by_oid';
13
13
  import { RowValue } from '../row';
14
+ import { l10n } from '../../../utils';
14
15
  export const BasicExtension = (props, children) => {
15
16
  const { extension } = props;
16
17
  return ([
17
18
  h(RowValue, { name: "Name", value: getStringByOID(extension.asn.extnID) }),
18
- h(RowValue, { name: "Critical", value: extension.asn.critical ? 'Yes' : 'No' }),
19
+ h(RowValue, { name: "Critical", value: extension.asn.critical ? l10n.getString('yes') : l10n.getString('no') }),
19
20
  children,
20
21
  h("tr", null,
21
22
  h("td", { colSpan: 2, class: "divider" },
@@ -0,0 +1,19 @@
1
+ /*!
2
+ * © Peculiar Ventures https://peculiarventures.com/ - MIT License
3
+ */
4
+ /**
5
+ * @license
6
+ * Copyright (c) Peculiar Ventures, LLC.
7
+ *
8
+ * This source code is licensed under the MIT license found in the
9
+ * LICENSE file in the root directory of this source tree.
10
+ */
11
+ import { h } from '@stencil/core';
12
+ import { RowValue } from '../row';
13
+ import { l10n } from '../../../utils';
14
+ import { BasicExtension } from './basic_extension';
15
+ export const CRLNumberExtension = (props) => {
16
+ const { extension } = props;
17
+ return (h(BasicExtension, { extension: extension },
18
+ h(RowValue, { name: l10n.getString('value'), value: extension.value.value })));
19
+ };
@@ -9,7 +9,7 @@
9
9
  * LICENSE file in the root directory of this source tree.
10
10
  */
11
11
  import { h } from '@stencil/core';
12
- import { KeyUsage, BasicConstraints, ExtendedKeyUsage, SubjectKeyIdentifier, AuthorityKeyIdentifier, CRLDistributionPoints, AuthorityInfoAccessSyntax, SubjectAlternativeName, CertificatePolicies, NameConstraints, CRLReason, SubjectDirectoryAttributes, PrivateKeyUsagePeriod, EntrustVersionInfo, PolicyConstraints, PolicyMappings, SubjectInfoAccessSyntax, } from '@peculiar/asn1-x509';
12
+ import { KeyUsage, BasicConstraints, ExtendedKeyUsage, SubjectKeyIdentifier, AuthorityKeyIdentifier, CRLDistributionPoints, AuthorityInfoAccessSyntax, SubjectAlternativeName, CertificatePolicies, NameConstraints, CRLReason, CRLNumber, SubjectDirectoryAttributes, PrivateKeyUsagePeriod, EntrustVersionInfo, PolicyConstraints, PolicyMappings, SubjectInfoAccessSyntax, IssuingDistributionPoint, } from '@peculiar/asn1-x509';
13
13
  import { CertificateTransparency } from '@peculiar/asn1-cert-transparency';
14
14
  import { CertificateTemplate, EnrollCertTypeChoice, CaVersion, } from '@peculiar/asn1-x509-microsoft';
15
15
  import { QCStatements, BiometricSyntax } from '@peculiar/asn1-x509-qualified';
@@ -51,6 +51,8 @@ import { LogotypeExtension } from './logotype_extension';
51
51
  import { TNAuthListExtension } from './tn_auth_list_extension';
52
52
  import { PolicyConstraintsExtension } from './policy_constraints_extension';
53
53
  import { PolicyMappingsExtension } from './policy_mappings_extension';
54
+ import { CRLNumberExtension } from './crl_number_extension';
55
+ import { IssuingDistributionPointExtension } from './issuing_distribution_point_extension';
54
56
  export const Extensions = (props) => {
55
57
  const { extensions, title } = props;
56
58
  if (!extensions || !extensions.length) {
@@ -151,6 +153,12 @@ export const Extensions = (props) => {
151
153
  if (extension.value instanceof PolicyMappings) {
152
154
  return (h(PolicyMappingsExtension, { extension: extension }));
153
155
  }
156
+ if (extension.value instanceof CRLNumber) {
157
+ return (h(CRLNumberExtension, { extension: extension }));
158
+ }
159
+ if (extension.value instanceof IssuingDistributionPoint) {
160
+ return (h(IssuingDistributionPointExtension, Object.assign({ extension: extension }, props)));
161
+ }
154
162
  if (typeof extension.value === 'string') {
155
163
  return (h(AsStringExtension, { extension: extension }));
156
164
  }
@@ -0,0 +1,27 @@
1
+ /*!
2
+ * © Peculiar Ventures https://peculiarventures.com/ - MIT License
3
+ */
4
+ /**
5
+ * @license
6
+ * Copyright (c) Peculiar Ventures, LLC.
7
+ *
8
+ * This source code is licensed under the MIT license found in the
9
+ * LICENSE file in the root directory of this source tree.
10
+ */
11
+ import { h } from '@stencil/core';
12
+ import { RowValue } from '../row';
13
+ import { l10n } from '../../../utils';
14
+ import { BasicExtension } from './basic_extension';
15
+ import { GeneralNamePart } from './general_name_part';
16
+ // eslint-disable-next-line max-len
17
+ export const IssuingDistributionPointExtension = (props) => {
18
+ var _a;
19
+ const { extension } = props;
20
+ return (h(BasicExtension, { extension: extension }, (_a = extension.value.distributionPoint) === null || _a === void 0 ? void 0 :
21
+ _a.fullName.map((gn) => (h(GeneralNamePart, Object.assign({ generalName: gn }, props)))),
22
+ extension.value.onlySomeReasons && (h(RowValue, { name: l10n.getString('onlyReasons'), value: extension.value.onlySomeReasons.toJSON().join(', ') })),
23
+ extension.value.indirectCRL && (h(RowValue, { name: l10n.getString('indirectCRL'), value: l10n.getString('yes') })),
24
+ extension.value.onlyContainsUserCerts && (h(RowValue, { name: l10n.getString('onlyUserCertificates'), value: l10n.getString('yes') })),
25
+ extension.value.onlyContainsAttributeCerts && (h(RowValue, { name: l10n.getString('onlyAttributeCertificates'), value: l10n.getString('yes') })),
26
+ extension.value.onlyContainsCACerts && (h(RowValue, { name: l10n.getString('onlyCACertificates'), value: l10n.getString('yes') }))));
27
+ };
@@ -10,6 +10,7 @@
10
10
  */
11
11
  import { h } from '@stencil/core';
12
12
  import { RowValue } from '../row';
13
+ import { l10n } from '../../../utils';
13
14
  import { BasicExtension } from './basic_extension';
14
15
  import { GeneralNamePart } from './general_name_part';
15
16
  export const TimestampExtension = (props) => {
@@ -17,5 +18,5 @@ export const TimestampExtension = (props) => {
17
18
  return (h(BasicExtension, { extension: extension },
18
19
  h(RowValue, { name: "Version", value: extension.value.version }),
19
20
  h(GeneralNamePart, Object.assign({ generalName: extension.value.location }, props)),
20
- h(RowValue, { name: "Requires Auth", value: extension.value.requiresAuth ? 'Yes' : 'No' })));
21
+ h(RowValue, { name: "Requires Auth", value: extension.value.requiresAuth ? l10n.getString('yes') : l10n.getString('no') })));
21
22
  };
@@ -9,26 +9,8 @@
9
9
  * LICENSE file in the root directory of this source tree.
10
10
  */
11
11
  import { h } from '@stencil/core';
12
- import { CSR } from '../../crypto';
13
12
  import { l10n } from '../../utils';
14
- import { Download } from '../../utils/download';
15
13
  import { RowTitle } from './row';
16
- function downloadCertificateAsPem(certificate) {
17
- if (certificate instanceof CSR) {
18
- Download.pkcs10.asPEM(certificate.exportAsPemFormatted(), certificate.commonName);
19
- }
20
- else {
21
- Download.x509.asPEM(certificate.exportAsPemFormatted(), certificate.commonName);
22
- }
23
- }
24
- function downloadCertificateAsDer(certificate) {
25
- if (certificate instanceof CSR) {
26
- Download.pkcs10.asDER(certificate.exportAsHexFormatted(), certificate.commonName);
27
- }
28
- else {
29
- Download.x509.asDER(certificate.exportAsHexFormatted(), certificate.commonName);
30
- }
31
- }
32
14
  export const Miscellaneous = (props) => {
33
15
  const { certificate } = props;
34
16
  return [
@@ -39,9 +21,9 @@ export const Miscellaneous = (props) => {
39
21
  l10n.getString('download'),
40
22
  ":")),
41
23
  h("td", null,
42
- h("peculiar-button-split", { onClick: downloadCertificateAsPem.bind(this, certificate), actions: [{
24
+ h("peculiar-button-split", { onClick: () => certificate.downloadAsPEM(), actions: [{
43
25
  text: l10n.getString('download.der'),
44
- onClick: downloadCertificateAsDer.bind(this, certificate),
26
+ onClick: () => certificate.downloadAsDER(),
45
27
  }] }, l10n.getString('download.pem')))),
46
28
  ];
47
29
  };
@@ -11,7 +11,6 @@
11
11
  import { Component, h, Prop, State, Watch, Host, Event, } from '@stencil/core';
12
12
  import { X509Certificate } from '../../crypto';
13
13
  import { OIDs } from '../../constants/oids';
14
- import { Download } from '../../utils/download';
15
14
  import { l10n } from '../../utils';
16
15
  export class CertificatesViewer {
17
16
  constructor() {
@@ -102,12 +101,12 @@ export class CertificatesViewer {
102
101
  // eslint-disable-next-line class-methods-use-this
103
102
  handleClickDownloadAsPem(certificate, e) {
104
103
  e.stopPropagation();
105
- Download.x509.asPEM(certificate.body.exportAsPemFormatted(), certificate.name || certificate.body.commonName);
104
+ certificate.body.downloadAsPEM(certificate.name || certificate.body.commonName);
106
105
  }
107
106
  // eslint-disable-next-line class-methods-use-this
108
107
  handleClickDownloadAsDer(certificate, e) {
109
108
  e.stopPropagation();
110
- Download.x509.asPEM(certificate.body.exportAsHexFormatted(), certificate.name || certificate.body.commonName);
109
+ certificate.body.downloadAsDER(certificate.name || certificate.body.commonName);
111
110
  }
112
111
  handleClickRow(index) {
113
112
  const isExpandedRowClicked = this.expandedRow === index;