enveloped_data.js 1.8 KB

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