kek_recipient_info.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import { __decorate } from "tslib";
  2. import { AsnProp, AsnPropTypes, OctetString, } from "@peculiar/asn1-schema";
  3. import { OtherKeyAttribute } from "./other_key_attribute.js";
  4. import { CMSVersion, KeyEncryptionAlgorithmIdentifier, } from "./types.js";
  5. export class KEKIdentifier {
  6. keyIdentifier = new OctetString();
  7. date;
  8. other;
  9. constructor(params = {}) {
  10. Object.assign(this, params);
  11. }
  12. }
  13. __decorate([
  14. AsnProp({ type: OctetString })
  15. ], KEKIdentifier.prototype, "keyIdentifier", void 0);
  16. __decorate([
  17. AsnProp({
  18. type: AsnPropTypes.GeneralizedTime, optional: true,
  19. })
  20. ], KEKIdentifier.prototype, "date", void 0);
  21. __decorate([
  22. AsnProp({
  23. type: OtherKeyAttribute, optional: true,
  24. })
  25. ], KEKIdentifier.prototype, "other", void 0);
  26. export class KEKRecipientInfo {
  27. version = CMSVersion.v4;
  28. kekid = new KEKIdentifier();
  29. keyEncryptionAlgorithm = new KeyEncryptionAlgorithmIdentifier();
  30. encryptedKey = new OctetString();
  31. constructor(params = {}) {
  32. Object.assign(this, params);
  33. }
  34. }
  35. __decorate([
  36. AsnProp({ type: AsnPropTypes.Integer })
  37. ], KEKRecipientInfo.prototype, "version", void 0);
  38. __decorate([
  39. AsnProp({ type: KEKIdentifier })
  40. ], KEKRecipientInfo.prototype, "kekid", void 0);
  41. __decorate([
  42. AsnProp({ type: KeyEncryptionAlgorithmIdentifier })
  43. ], KEKRecipientInfo.prototype, "keyEncryptionAlgorithm", void 0);
  44. __decorate([
  45. AsnProp({ type: OctetString })
  46. ], KEKRecipientInfo.prototype, "encryptedKey", void 0);