signer_info.js 2.4 KB

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