signed_data.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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, itemType: DigestAlgorithmIdentifier,
  18. })
  19. ], DigestAlgorithmIdentifiers);
  20. export { DigestAlgorithmIdentifiers };
  21. export class SignedData {
  22. version = CMSVersion.v0;
  23. digestAlgorithms = new DigestAlgorithmIdentifiers();
  24. encapContentInfo = new EncapsulatedContentInfo();
  25. certificates;
  26. crls;
  27. signerInfos = new SignerInfos();
  28. constructor(params = {}) {
  29. Object.assign(this, params);
  30. }
  31. }
  32. __decorate([
  33. AsnProp({ type: AsnPropTypes.Integer })
  34. ], SignedData.prototype, "version", void 0);
  35. __decorate([
  36. AsnProp({ type: DigestAlgorithmIdentifiers })
  37. ], SignedData.prototype, "digestAlgorithms", void 0);
  38. __decorate([
  39. AsnProp({ type: EncapsulatedContentInfo })
  40. ], SignedData.prototype, "encapContentInfo", void 0);
  41. __decorate([
  42. AsnProp({
  43. type: CertificateSet, context: 0, implicit: true, optional: true,
  44. })
  45. ], SignedData.prototype, "certificates", void 0);
  46. __decorate([
  47. AsnProp({
  48. type: RevocationInfoChoices, context: 1, implicit: true, optional: true,
  49. })
  50. ], SignedData.prototype, "crls", void 0);
  51. __decorate([
  52. AsnProp({ type: SignerInfos })
  53. ], SignedData.prototype, "signerInfos", void 0);