kek_recipient_info.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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,
  19. optional: true,
  20. })
  21. ], KEKIdentifier.prototype, "date", void 0);
  22. __decorate([
  23. AsnProp({
  24. type: OtherKeyAttribute,
  25. optional: true,
  26. })
  27. ], KEKIdentifier.prototype, "other", void 0);
  28. export class KEKRecipientInfo {
  29. version = CMSVersion.v4;
  30. kekid = new KEKIdentifier();
  31. keyEncryptionAlgorithm = new KeyEncryptionAlgorithmIdentifier();
  32. encryptedKey = new OctetString();
  33. constructor(params = {}) {
  34. Object.assign(this, params);
  35. }
  36. }
  37. __decorate([
  38. AsnProp({ type: AsnPropTypes.Integer })
  39. ], KEKRecipientInfo.prototype, "version", void 0);
  40. __decorate([
  41. AsnProp({ type: KEKIdentifier })
  42. ], KEKRecipientInfo.prototype, "kekid", void 0);
  43. __decorate([
  44. AsnProp({ type: KeyEncryptionAlgorithmIdentifier })
  45. ], KEKRecipientInfo.prototype, "keyEncryptionAlgorithm", void 0);
  46. __decorate([
  47. AsnProp({ type: OctetString })
  48. ], KEKRecipientInfo.prototype, "encryptedKey", void 0);