name_constraints.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. constructor(params = {}) {
  12. this.base = new general_name_1.GeneralName();
  13. this.minimum = 0;
  14. Object.assign(this, params);
  15. }
  16. }
  17. exports.GeneralSubtree = GeneralSubtree;
  18. tslib_1.__decorate([
  19. (0, asn1_schema_1.AsnProp)({ type: general_name_1.GeneralName })
  20. ], GeneralSubtree.prototype, "base", void 0);
  21. tslib_1.__decorate([
  22. (0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Integer, context: 0, defaultValue: 0, implicit: true })
  23. ], GeneralSubtree.prototype, "minimum", void 0);
  24. tslib_1.__decorate([
  25. (0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Integer, context: 1, optional: true, implicit: true })
  26. ], GeneralSubtree.prototype, "maximum", void 0);
  27. let GeneralSubtrees = GeneralSubtrees_1 = class GeneralSubtrees extends asn1_schema_1.AsnArray {
  28. constructor(items) {
  29. super(items);
  30. Object.setPrototypeOf(this, GeneralSubtrees_1.prototype);
  31. }
  32. };
  33. exports.GeneralSubtrees = GeneralSubtrees;
  34. exports.GeneralSubtrees = GeneralSubtrees = GeneralSubtrees_1 = tslib_1.__decorate([
  35. (0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence, itemType: GeneralSubtree })
  36. ], GeneralSubtrees);
  37. class NameConstraints {
  38. constructor(params = {}) {
  39. Object.assign(this, params);
  40. }
  41. }
  42. exports.NameConstraints = NameConstraints;
  43. tslib_1.__decorate([
  44. (0, asn1_schema_1.AsnProp)({ type: GeneralSubtrees, context: 0, optional: true, implicit: true })
  45. ], NameConstraints.prototype, "permittedSubtrees", void 0);
  46. tslib_1.__decorate([
  47. (0, asn1_schema_1.AsnProp)({ type: GeneralSubtrees, context: 1, optional: true, implicit: true })
  48. ], NameConstraints.prototype, "excludedSubtrees", void 0);