signed_data.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. var DigestAlgorithmIdentifiers_1;
  2. import { __decorate } from "tslib";
  3. import { AsnProp, AsnPropTypes, AsnArray, AsnType, AsnTypeTypes } from "@peculiar/asn1-schema";
  4. import { CertificateSet } from "./certificate_choices.js";
  5. import { CMSVersion, DigestAlgorithmIdentifier } from "./types.js";
  6. import { EncapsulatedContentInfo } from "./encapsulated_content_info.js";
  7. import { RevocationInfoChoices } from "./revocation_info_choice.js";
  8. import { SignerInfos } from "./signer_info.js";
  9. let DigestAlgorithmIdentifiers = DigestAlgorithmIdentifiers_1 = class DigestAlgorithmIdentifiers extends AsnArray {
  10. constructor(items) {
  11. super(items);
  12. Object.setPrototypeOf(this, DigestAlgorithmIdentifiers_1.prototype);
  13. }
  14. };
  15. DigestAlgorithmIdentifiers = DigestAlgorithmIdentifiers_1 = __decorate([
  16. AsnType({
  17. type: AsnTypeTypes.Set,
  18. itemType: DigestAlgorithmIdentifier,
  19. })
  20. ], DigestAlgorithmIdentifiers);
  21. export { DigestAlgorithmIdentifiers };
  22. export class SignedData {
  23. version = CMSVersion.v0;
  24. digestAlgorithms = new DigestAlgorithmIdentifiers();
  25. encapContentInfo = new EncapsulatedContentInfo();
  26. certificates;
  27. crls;
  28. signerInfos = new SignerInfos();
  29. constructor(params = {}) {
  30. Object.assign(this, params);
  31. }
  32. }
  33. __decorate([
  34. AsnProp({ type: AsnPropTypes.Integer })
  35. ], SignedData.prototype, "version", void 0);
  36. __decorate([
  37. AsnProp({ type: DigestAlgorithmIdentifiers })
  38. ], SignedData.prototype, "digestAlgorithms", void 0);
  39. __decorate([
  40. AsnProp({ type: EncapsulatedContentInfo })
  41. ], SignedData.prototype, "encapContentInfo", void 0);
  42. __decorate([
  43. AsnProp({
  44. type: CertificateSet,
  45. context: 0,
  46. implicit: true,
  47. optional: true,
  48. })
  49. ], SignedData.prototype, "certificates", void 0);
  50. __decorate([
  51. AsnProp({
  52. type: RevocationInfoChoices,
  53. context: 1,
  54. implicit: true,
  55. optional: true,
  56. })
  57. ], SignedData.prototype, "crls", void 0);
  58. __decorate([
  59. AsnProp({ type: SignerInfos })
  60. ], SignedData.prototype, "signerInfos", void 0);