signer_info.js 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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,
  52. repeated: "set",
  53. context: 1,
  54. implicit: true,
  55. optional: true,
  56. })
  57. ], SignerInfo.prototype, "unsignedAttrs", void 0);
  58. let SignerInfos = SignerInfos_1 = class SignerInfos extends asn1_schema_1.AsnArray {
  59. constructor(items) {
  60. super(items);
  61. Object.setPrototypeOf(this, SignerInfos_1.prototype);
  62. }
  63. };
  64. exports.SignerInfos = SignerInfos;
  65. exports.SignerInfos = SignerInfos = SignerInfos_1 = tslib_1.__decorate([
  66. (0, asn1_schema_1.AsnType)({
  67. type: asn1_schema_1.AsnTypeTypes.Set,
  68. itemType: SignerInfo,
  69. })
  70. ], SignerInfos);