kek_recipient_info.js 1.5 KB

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