name_constraints.js 1.8 KB

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