kek_recipient_info.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. constructor(params = {}) {
  10. this.keyIdentifier = new asn1_schema_1.OctetString();
  11. Object.assign(this, params);
  12. }
  13. }
  14. exports.KEKIdentifier = KEKIdentifier;
  15. tslib_1.__decorate([
  16. (0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.OctetString })
  17. ], KEKIdentifier.prototype, "keyIdentifier", void 0);
  18. tslib_1.__decorate([
  19. (0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.GeneralizedTime, optional: true })
  20. ], KEKIdentifier.prototype, "date", void 0);
  21. tslib_1.__decorate([
  22. (0, asn1_schema_1.AsnProp)({ type: other_key_attribute_1.OtherKeyAttribute, optional: true })
  23. ], KEKIdentifier.prototype, "other", void 0);
  24. class KEKRecipientInfo {
  25. constructor(params = {}) {
  26. this.version = types_1.CMSVersion.v4;
  27. this.kekid = new KEKIdentifier();
  28. this.keyEncryptionAlgorithm = new types_1.KeyEncryptionAlgorithmIdentifier();
  29. this.encryptedKey = new asn1_schema_1.OctetString();
  30. Object.assign(this, params);
  31. }
  32. }
  33. exports.KEKRecipientInfo = KEKRecipientInfo;
  34. tslib_1.__decorate([
  35. (0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Integer })
  36. ], KEKRecipientInfo.prototype, "version", void 0);
  37. tslib_1.__decorate([
  38. (0, asn1_schema_1.AsnProp)({ type: KEKIdentifier })
  39. ], KEKRecipientInfo.prototype, "kekid", void 0);
  40. tslib_1.__decorate([
  41. (0, asn1_schema_1.AsnProp)({ type: types_1.KeyEncryptionAlgorithmIdentifier })
  42. ], KEKRecipientInfo.prototype, "keyEncryptionAlgorithm", void 0);
  43. tslib_1.__decorate([
  44. (0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.OctetString })
  45. ], KEKRecipientInfo.prototype, "encryptedKey", void 0);