signer_info.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. var SignerInfos_1;
  2. import { __decorate } from "tslib";
  3. import { AsnProp, AsnPropTypes, AsnArray, AsnType, AsnTypeTypes, OctetString, } from "@peculiar/asn1-schema";
  4. import { SignerIdentifier } from "./signer_identifier.js";
  5. import { CMSVersion, SignatureAlgorithmIdentifier, DigestAlgorithmIdentifier, } from "./types.js";
  6. import { Attribute } from "./attribute.js";
  7. export class SignerInfo {
  8. version = CMSVersion.v0;
  9. sid = new SignerIdentifier();
  10. digestAlgorithm = new DigestAlgorithmIdentifier();
  11. signedAttrs;
  12. signedAttrsRaw;
  13. signatureAlgorithm = new SignatureAlgorithmIdentifier();
  14. signature = new OctetString();
  15. unsignedAttrs;
  16. constructor(params = {}) {
  17. Object.assign(this, params);
  18. }
  19. }
  20. __decorate([
  21. AsnProp({ type: AsnPropTypes.Integer })
  22. ], SignerInfo.prototype, "version", void 0);
  23. __decorate([
  24. AsnProp({ type: SignerIdentifier })
  25. ], SignerInfo.prototype, "sid", void 0);
  26. __decorate([
  27. AsnProp({ type: DigestAlgorithmIdentifier })
  28. ], SignerInfo.prototype, "digestAlgorithm", void 0);
  29. __decorate([
  30. AsnProp({
  31. type: Attribute,
  32. repeated: "set",
  33. context: 0,
  34. implicit: true,
  35. optional: true,
  36. raw: true,
  37. })
  38. ], SignerInfo.prototype, "signedAttrs", void 0);
  39. __decorate([
  40. AsnProp({ type: SignatureAlgorithmIdentifier })
  41. ], SignerInfo.prototype, "signatureAlgorithm", void 0);
  42. __decorate([
  43. AsnProp({ type: OctetString })
  44. ], SignerInfo.prototype, "signature", void 0);
  45. __decorate([
  46. AsnProp({
  47. type: Attribute, repeated: "set", context: 1, implicit: true, optional: true,
  48. })
  49. ], SignerInfo.prototype, "unsignedAttrs", void 0);
  50. let SignerInfos = SignerInfos_1 = class SignerInfos extends AsnArray {
  51. constructor(items) {
  52. super(items);
  53. Object.setPrototypeOf(this, SignerInfos_1.prototype);
  54. }
  55. };
  56. SignerInfos = SignerInfos_1 = __decorate([
  57. AsnType({
  58. type: AsnTypeTypes.Set, itemType: SignerInfo,
  59. })
  60. ], SignerInfos);
  61. export { SignerInfos };