kek_recipient_info.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.KEKRecipientInfo = exports.KEKIdentifier = void 0;
  4. const tslib_1 = require("tslib");
  5. const asn1_schema_1 = require("@peculiar/asn1-schema");
  6. const other_key_attribute_1 = require("./other_key_attribute");
  7. const types_1 = require("./types");
  8. class KEKIdentifier {
  9. keyIdentifier = new asn1_schema_1.OctetString();
  10. date;
  11. other;
  12. constructor(params = {}) {
  13. Object.assign(this, params);
  14. }
  15. }
  16. exports.KEKIdentifier = KEKIdentifier;
  17. tslib_1.__decorate([
  18. (0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.OctetString })
  19. ], KEKIdentifier.prototype, "keyIdentifier", void 0);
  20. tslib_1.__decorate([
  21. (0, asn1_schema_1.AsnProp)({
  22. type: asn1_schema_1.AsnPropTypes.GeneralizedTime,
  23. optional: true,
  24. })
  25. ], KEKIdentifier.prototype, "date", void 0);
  26. tslib_1.__decorate([
  27. (0, asn1_schema_1.AsnProp)({
  28. type: other_key_attribute_1.OtherKeyAttribute,
  29. optional: true,
  30. })
  31. ], KEKIdentifier.prototype, "other", void 0);
  32. class KEKRecipientInfo {
  33. version = types_1.CMSVersion.v4;
  34. kekid = new KEKIdentifier();
  35. keyEncryptionAlgorithm = new types_1.KeyEncryptionAlgorithmIdentifier();
  36. encryptedKey = new asn1_schema_1.OctetString();
  37. constructor(params = {}) {
  38. Object.assign(this, params);
  39. }
  40. }
  41. exports.KEKRecipientInfo = KEKRecipientInfo;
  42. tslib_1.__decorate([
  43. (0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Integer })
  44. ], KEKRecipientInfo.prototype, "version", void 0);
  45. tslib_1.__decorate([
  46. (0, asn1_schema_1.AsnProp)({ type: KEKIdentifier })
  47. ], KEKRecipientInfo.prototype, "kekid", void 0);
  48. tslib_1.__decorate([
  49. (0, asn1_schema_1.AsnProp)({ type: types_1.KeyEncryptionAlgorithmIdentifier })
  50. ], KEKRecipientInfo.prototype, "keyEncryptionAlgorithm", void 0);
  51. tslib_1.__decorate([
  52. (0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.OctetString })
  53. ], KEKRecipientInfo.prototype, "encryptedKey", void 0);