name_constraints.js 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. "use strict";
  2. var GeneralSubtrees_1;
  3. Object.defineProperty(exports, "__esModule", { value: true });
  4. exports.NameConstraints = exports.GeneralSubtrees = exports.GeneralSubtree = exports.id_ce_nameConstraints = void 0;
  5. const tslib_1 = require("tslib");
  6. const asn1_schema_1 = require("@peculiar/asn1-schema");
  7. const general_name_1 = require("../general_name");
  8. const object_identifiers_1 = require("../object_identifiers");
  9. exports.id_ce_nameConstraints = `${object_identifiers_1.id_ce}.30`;
  10. class GeneralSubtree {
  11. base = new general_name_1.GeneralName();
  12. minimum = 0;
  13. maximum;
  14. constructor(params = {}) {
  15. Object.assign(this, params);
  16. }
  17. }
  18. exports.GeneralSubtree = GeneralSubtree;
  19. tslib_1.__decorate([
  20. (0, asn1_schema_1.AsnProp)({ type: general_name_1.GeneralName })
  21. ], GeneralSubtree.prototype, "base", void 0);
  22. tslib_1.__decorate([
  23. (0, asn1_schema_1.AsnProp)({
  24. type: asn1_schema_1.AsnPropTypes.Integer,
  25. context: 0,
  26. defaultValue: 0,
  27. implicit: true,
  28. })
  29. ], GeneralSubtree.prototype, "minimum", void 0);
  30. tslib_1.__decorate([
  31. (0, asn1_schema_1.AsnProp)({
  32. type: asn1_schema_1.AsnPropTypes.Integer,
  33. context: 1,
  34. optional: true,
  35. implicit: true,
  36. })
  37. ], GeneralSubtree.prototype, "maximum", void 0);
  38. let GeneralSubtrees = GeneralSubtrees_1 = class GeneralSubtrees extends asn1_schema_1.AsnArray {
  39. constructor(items) {
  40. super(items);
  41. Object.setPrototypeOf(this, GeneralSubtrees_1.prototype);
  42. }
  43. };
  44. exports.GeneralSubtrees = GeneralSubtrees;
  45. exports.GeneralSubtrees = GeneralSubtrees = GeneralSubtrees_1 = tslib_1.__decorate([
  46. (0, asn1_schema_1.AsnType)({
  47. type: asn1_schema_1.AsnTypeTypes.Sequence,
  48. itemType: GeneralSubtree,
  49. })
  50. ], GeneralSubtrees);
  51. class NameConstraints {
  52. permittedSubtrees;
  53. excludedSubtrees;
  54. constructor(params = {}) {
  55. Object.assign(this, params);
  56. }
  57. }
  58. exports.NameConstraints = NameConstraints;
  59. tslib_1.__decorate([
  60. (0, asn1_schema_1.AsnProp)({
  61. type: GeneralSubtrees,
  62. context: 0,
  63. optional: true,
  64. implicit: true,
  65. })
  66. ], NameConstraints.prototype, "permittedSubtrees", void 0);
  67. tslib_1.__decorate([
  68. (0, asn1_schema_1.AsnProp)({
  69. type: GeneralSubtrees,
  70. context: 1,
  71. optional: true,
  72. implicit: true,
  73. })
  74. ], NameConstraints.prototype, "excludedSubtrees", void 0);