enveloped_data.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. "use strict";
  2. var UnprotectedAttributes_1;
  3. Object.defineProperty(exports, "__esModule", { value: true });
  4. exports.EnvelopedData = exports.UnprotectedAttributes = void 0;
  5. const tslib_1 = require("tslib");
  6. const asn1_schema_1 = require("@peculiar/asn1-schema");
  7. const types_1 = require("./types");
  8. const attribute_1 = require("./attribute");
  9. const recipient_infos_1 = require("./recipient_infos");
  10. const originator_info_1 = require("./originator_info");
  11. const encrypted_content_info_1 = require("./encrypted_content_info");
  12. let UnprotectedAttributes = UnprotectedAttributes_1 = class UnprotectedAttributes extends asn1_schema_1.AsnArray {
  13. constructor(items) {
  14. super(items);
  15. Object.setPrototypeOf(this, UnprotectedAttributes_1.prototype);
  16. }
  17. };
  18. exports.UnprotectedAttributes = UnprotectedAttributes;
  19. exports.UnprotectedAttributes = UnprotectedAttributes = UnprotectedAttributes_1 = tslib_1.__decorate([
  20. (0, asn1_schema_1.AsnType)({
  21. type: asn1_schema_1.AsnTypeTypes.Set,
  22. itemType: attribute_1.Attribute,
  23. })
  24. ], UnprotectedAttributes);
  25. class EnvelopedData {
  26. version = types_1.CMSVersion.v0;
  27. originatorInfo;
  28. recipientInfos = new recipient_infos_1.RecipientInfos();
  29. encryptedContentInfo = new encrypted_content_info_1.EncryptedContentInfo();
  30. unprotectedAttrs;
  31. constructor(params = {}) {
  32. Object.assign(this, params);
  33. }
  34. }
  35. exports.EnvelopedData = EnvelopedData;
  36. tslib_1.__decorate([
  37. (0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Integer })
  38. ], EnvelopedData.prototype, "version", void 0);
  39. tslib_1.__decorate([
  40. (0, asn1_schema_1.AsnProp)({
  41. type: originator_info_1.OriginatorInfo,
  42. context: 0,
  43. implicit: true,
  44. optional: true,
  45. })
  46. ], EnvelopedData.prototype, "originatorInfo", void 0);
  47. tslib_1.__decorate([
  48. (0, asn1_schema_1.AsnProp)({ type: recipient_infos_1.RecipientInfos })
  49. ], EnvelopedData.prototype, "recipientInfos", void 0);
  50. tslib_1.__decorate([
  51. (0, asn1_schema_1.AsnProp)({ type: encrypted_content_info_1.EncryptedContentInfo })
  52. ], EnvelopedData.prototype, "encryptedContentInfo", void 0);
  53. tslib_1.__decorate([
  54. (0, asn1_schema_1.AsnProp)({
  55. type: UnprotectedAttributes,
  56. context: 1,
  57. implicit: true,
  58. optional: true,
  59. })
  60. ], EnvelopedData.prototype, "unprotectedAttrs", void 0);