rsa_private_key.js 2.7 KB

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