target.js 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. "use strict";
  2. var Targets_1;
  3. Object.defineProperty(exports, "__esModule", { value: true });
  4. exports.Targets = exports.Target = exports.TargetCert = void 0;
  5. const tslib_1 = require("tslib");
  6. const asn1_schema_1 = require("@peculiar/asn1-schema");
  7. const asn1_x509_1 = require("@peculiar/asn1-x509");
  8. const issuer_serial_1 = require("./issuer_serial");
  9. const object_digest_info_1 = require("./object_digest_info");
  10. class TargetCert {
  11. targetCertificate = new issuer_serial_1.IssuerSerial();
  12. targetName;
  13. certDigestInfo;
  14. constructor(params = {}) {
  15. Object.assign(this, params);
  16. }
  17. }
  18. exports.TargetCert = TargetCert;
  19. tslib_1.__decorate([
  20. (0, asn1_schema_1.AsnProp)({ type: issuer_serial_1.IssuerSerial })
  21. ], TargetCert.prototype, "targetCertificate", void 0);
  22. tslib_1.__decorate([
  23. (0, asn1_schema_1.AsnProp)({
  24. type: asn1_x509_1.GeneralName,
  25. optional: true,
  26. })
  27. ], TargetCert.prototype, "targetName", void 0);
  28. tslib_1.__decorate([
  29. (0, asn1_schema_1.AsnProp)({
  30. type: object_digest_info_1.ObjectDigestInfo,
  31. optional: true,
  32. })
  33. ], TargetCert.prototype, "certDigestInfo", void 0);
  34. let Target = class Target {
  35. targetName;
  36. targetGroup;
  37. targetCert;
  38. constructor(params = {}) {
  39. Object.assign(this, params);
  40. }
  41. };
  42. exports.Target = Target;
  43. tslib_1.__decorate([
  44. (0, asn1_schema_1.AsnProp)({
  45. type: asn1_x509_1.GeneralName,
  46. context: 0,
  47. implicit: true,
  48. })
  49. ], Target.prototype, "targetName", void 0);
  50. tslib_1.__decorate([
  51. (0, asn1_schema_1.AsnProp)({
  52. type: asn1_x509_1.GeneralName,
  53. context: 1,
  54. implicit: true,
  55. })
  56. ], Target.prototype, "targetGroup", void 0);
  57. tslib_1.__decorate([
  58. (0, asn1_schema_1.AsnProp)({
  59. type: TargetCert,
  60. context: 2,
  61. implicit: true,
  62. })
  63. ], Target.prototype, "targetCert", void 0);
  64. exports.Target = Target = tslib_1.__decorate([
  65. (0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })
  66. ], Target);
  67. let Targets = Targets_1 = class Targets extends asn1_schema_1.AsnArray {
  68. constructor(items) {
  69. super(items);
  70. Object.setPrototypeOf(this, Targets_1.prototype);
  71. }
  72. };
  73. exports.Targets = Targets;
  74. exports.Targets = Targets = Targets_1 = tslib_1.__decorate([
  75. (0, asn1_schema_1.AsnType)({
  76. type: asn1_schema_1.AsnTypeTypes.Sequence,
  77. itemType: Target,
  78. })
  79. ], Targets);