rfc3279.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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,
  41. optional: true,
  42. })
  43. ], Curve.prototype, "seed", void 0);
  44. Curve = __decorate([
  45. AsnType({ type: AsnTypeTypes.Sequence })
  46. ], Curve);
  47. export { Curve };
  48. export var ECPVer;
  49. (function (ECPVer) {
  50. ECPVer[ECPVer["ecpVer1"] = 1] = "ecpVer1";
  51. })(ECPVer || (ECPVer = {}));
  52. let SpecifiedECDomain = class SpecifiedECDomain {
  53. version = ECPVer.ecpVer1;
  54. fieldID;
  55. curve;
  56. base;
  57. order;
  58. cofactor;
  59. constructor(params = {}) {
  60. Object.assign(this, params);
  61. }
  62. };
  63. __decorate([
  64. AsnProp({ type: AsnPropTypes.Integer })
  65. ], SpecifiedECDomain.prototype, "version", void 0);
  66. __decorate([
  67. AsnProp({ type: FieldID })
  68. ], SpecifiedECDomain.prototype, "fieldID", void 0);
  69. __decorate([
  70. AsnProp({ type: Curve })
  71. ], SpecifiedECDomain.prototype, "curve", void 0);
  72. __decorate([
  73. AsnProp({ type: ECPoint })
  74. ], SpecifiedECDomain.prototype, "base", void 0);
  75. __decorate([
  76. AsnProp({
  77. type: AsnPropTypes.Integer,
  78. converter: AsnIntegerArrayBufferConverter,
  79. })
  80. ], SpecifiedECDomain.prototype, "order", void 0);
  81. __decorate([
  82. AsnProp({
  83. type: AsnPropTypes.Integer,
  84. optional: true,
  85. })
  86. ], SpecifiedECDomain.prototype, "cofactor", void 0);
  87. SpecifiedECDomain = __decorate([
  88. AsnType({ type: AsnTypeTypes.Sequence })
  89. ], SpecifiedECDomain);
  90. export { SpecifiedECDomain };