enveloped_data.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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, itemType: Attribute,
  18. })
  19. ], UnprotectedAttributes);
  20. export { UnprotectedAttributes };
  21. export class EnvelopedData {
  22. version = CMSVersion.v0;
  23. originatorInfo;
  24. recipientInfos = new RecipientInfos();
  25. encryptedContentInfo = new EncryptedContentInfo();
  26. unprotectedAttrs;
  27. constructor(params = {}) {
  28. Object.assign(this, params);
  29. }
  30. }
  31. __decorate([
  32. AsnProp({ type: AsnPropTypes.Integer })
  33. ], EnvelopedData.prototype, "version", void 0);
  34. __decorate([
  35. AsnProp({
  36. type: OriginatorInfo, context: 0, implicit: true, optional: true,
  37. })
  38. ], EnvelopedData.prototype, "originatorInfo", void 0);
  39. __decorate([
  40. AsnProp({ type: RecipientInfos })
  41. ], EnvelopedData.prototype, "recipientInfos", void 0);
  42. __decorate([
  43. AsnProp({ type: EncryptedContentInfo })
  44. ], EnvelopedData.prototype, "encryptedContentInfo", void 0);
  45. __decorate([
  46. AsnProp({
  47. type: UnprotectedAttributes, context: 1, implicit: true, optional: true,
  48. })
  49. ], EnvelopedData.prototype, "unprotectedAttrs", void 0);