rfc3279.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. import { __decorate } from "tslib";
  2. import { AsnType, AsnTypeTypes, AsnProp, AsnPropTypes, OctetString, AsnIntegerArrayBufferConverter, } from "@peculiar/asn1-schema";
  3. let FieldID = class FieldID {
  4. fieldType;
  5. parameters;
  6. constructor(params = {}) {
  7. Object.assign(this, params);
  8. }
  9. };
  10. __decorate([
  11. AsnProp({ type: AsnPropTypes.ObjectIdentifier })
  12. ], FieldID.prototype, "fieldType", void 0);
  13. __decorate([
  14. AsnProp({ type: AsnPropTypes.Any })
  15. ], FieldID.prototype, "parameters", void 0);
  16. FieldID = __decorate([
  17. AsnType({ type: AsnTypeTypes.Sequence })
  18. ], FieldID);
  19. export { FieldID };
  20. export class ECPoint extends OctetString {
  21. }
  22. export class FieldElement extends OctetString {
  23. }
  24. let Curve = class Curve {
  25. a;
  26. b;
  27. seed;
  28. constructor(params = {}) {
  29. Object.assign(this, params);
  30. }
  31. };
  32. __decorate([
  33. AsnProp({ type: AsnPropTypes.OctetString })
  34. ], Curve.prototype, "a", void 0);
  35. __decorate([
  36. AsnProp({ type: AsnPropTypes.OctetString })
  37. ], Curve.prototype, "b", void 0);
  38. __decorate([
  39. AsnProp({
  40. type: AsnPropTypes.BitString, optional: true,
  41. })
  42. ], Curve.prototype, "seed", void 0);
  43. Curve = __decorate([
  44. AsnType({ type: AsnTypeTypes.Sequence })
  45. ], Curve);
  46. export { Curve };
  47. export var ECPVer;
  48. (function (ECPVer) {
  49. ECPVer[ECPVer["ecpVer1"] = 1] = "ecpVer1";
  50. })(ECPVer || (ECPVer = {}));
  51. let SpecifiedECDomain = class SpecifiedECDomain {
  52. version = ECPVer.ecpVer1;
  53. fieldID;
  54. curve;
  55. base;
  56. order;
  57. cofactor;
  58. constructor(params = {}) {
  59. Object.assign(this, params);
  60. }
  61. };
  62. __decorate([
  63. AsnProp({ type: AsnPropTypes.Integer })
  64. ], SpecifiedECDomain.prototype, "version", void 0);
  65. __decorate([
  66. AsnProp({ type: FieldID })
  67. ], SpecifiedECDomain.prototype, "fieldID", void 0);
  68. __decorate([
  69. AsnProp({ type: Curve })
  70. ], SpecifiedECDomain.prototype, "curve", void 0);
  71. __decorate([
  72. AsnProp({ type: ECPoint })
  73. ], SpecifiedECDomain.prototype, "base", void 0);
  74. __decorate([
  75. AsnProp({
  76. type: AsnPropTypes.Integer, converter: AsnIntegerArrayBufferConverter,
  77. })
  78. ], SpecifiedECDomain.prototype, "order", void 0);
  79. __decorate([
  80. AsnProp({
  81. type: AsnPropTypes.Integer, optional: true,
  82. })
  83. ], SpecifiedECDomain.prototype, "cofactor", void 0);
  84. SpecifiedECDomain = __decorate([
  85. AsnType({ type: AsnTypeTypes.Sequence })
  86. ], SpecifiedECDomain);
  87. export { SpecifiedECDomain };