name_constraints.js 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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, context: 0, defaultValue: 0, implicit: true,
  25. })
  26. ], GeneralSubtree.prototype, "minimum", void 0);
  27. tslib_1.__decorate([
  28. (0, asn1_schema_1.AsnProp)({
  29. type: asn1_schema_1.AsnPropTypes.Integer, context: 1, optional: true, implicit: true,
  30. })
  31. ], GeneralSubtree.prototype, "maximum", void 0);
  32. let GeneralSubtrees = GeneralSubtrees_1 = class GeneralSubtrees extends asn1_schema_1.AsnArray {
  33. constructor(items) {
  34. super(items);
  35. Object.setPrototypeOf(this, GeneralSubtrees_1.prototype);
  36. }
  37. };
  38. exports.GeneralSubtrees = GeneralSubtrees;
  39. exports.GeneralSubtrees = GeneralSubtrees = GeneralSubtrees_1 = tslib_1.__decorate([
  40. (0, asn1_schema_1.AsnType)({
  41. type: asn1_schema_1.AsnTypeTypes.Sequence, itemType: GeneralSubtree,
  42. })
  43. ], GeneralSubtrees);
  44. class NameConstraints {
  45. permittedSubtrees;
  46. excludedSubtrees;
  47. constructor(params = {}) {
  48. Object.assign(this, params);
  49. }
  50. }
  51. exports.NameConstraints = NameConstraints;
  52. tslib_1.__decorate([
  53. (0, asn1_schema_1.AsnProp)({
  54. type: GeneralSubtrees, context: 0, optional: true, implicit: true,
  55. })
  56. ], NameConstraints.prototype, "permittedSubtrees", void 0);
  57. tslib_1.__decorate([
  58. (0, asn1_schema_1.AsnProp)({
  59. type: GeneralSubtrees, context: 1, optional: true, implicit: true,
  60. })
  61. ], NameConstraints.prototype, "excludedSubtrees", void 0);