rsa_private_key.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import { __decorate } from "tslib";
  2. import { AsnProp, AsnPropTypes, AsnIntegerArrayBufferConverter } from "@peculiar/asn1-schema";
  3. import { OtherPrimeInfos } from "./other_prime_info";
  4. export class RSAPrivateKey {
  5. constructor(params = {}) {
  6. this.version = 0;
  7. this.modulus = new ArrayBuffer(0);
  8. this.publicExponent = new ArrayBuffer(0);
  9. this.privateExponent = new ArrayBuffer(0);
  10. this.prime1 = new ArrayBuffer(0);
  11. this.prime2 = new ArrayBuffer(0);
  12. this.exponent1 = new ArrayBuffer(0);
  13. this.exponent2 = new ArrayBuffer(0);
  14. this.coefficient = new ArrayBuffer(0);
  15. Object.assign(this, params);
  16. }
  17. }
  18. __decorate([
  19. AsnProp({ type: AsnPropTypes.Integer })
  20. ], RSAPrivateKey.prototype, "version", void 0);
  21. __decorate([
  22. AsnProp({ type: AsnPropTypes.Integer, converter: AsnIntegerArrayBufferConverter })
  23. ], RSAPrivateKey.prototype, "modulus", void 0);
  24. __decorate([
  25. AsnProp({ type: AsnPropTypes.Integer, converter: AsnIntegerArrayBufferConverter })
  26. ], RSAPrivateKey.prototype, "publicExponent", void 0);
  27. __decorate([
  28. AsnProp({ type: AsnPropTypes.Integer, converter: AsnIntegerArrayBufferConverter })
  29. ], RSAPrivateKey.prototype, "privateExponent", void 0);
  30. __decorate([
  31. AsnProp({ type: AsnPropTypes.Integer, converter: AsnIntegerArrayBufferConverter })
  32. ], RSAPrivateKey.prototype, "prime1", void 0);
  33. __decorate([
  34. AsnProp({ type: AsnPropTypes.Integer, converter: AsnIntegerArrayBufferConverter })
  35. ], RSAPrivateKey.prototype, "prime2", void 0);
  36. __decorate([
  37. AsnProp({ type: AsnPropTypes.Integer, converter: AsnIntegerArrayBufferConverter })
  38. ], RSAPrivateKey.prototype, "exponent1", void 0);
  39. __decorate([
  40. AsnProp({ type: AsnPropTypes.Integer, converter: AsnIntegerArrayBufferConverter })
  41. ], RSAPrivateKey.prototype, "exponent2", void 0);
  42. __decorate([
  43. AsnProp({ type: AsnPropTypes.Integer, converter: AsnIntegerArrayBufferConverter })
  44. ], RSAPrivateKey.prototype, "coefficient", void 0);
  45. __decorate([
  46. AsnProp({ type: OtherPrimeInfos, optional: true })
  47. ], RSAPrivateKey.prototype, "otherPrimeInfos", void 0);