rsaes_oaep.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.RSAES_OAEP = exports.RsaEsOaepParams = void 0;
  4. const tslib_1 = require("tslib");
  5. const asn1_schema_1 = require("@peculiar/asn1-schema");
  6. const asn1_x509_1 = require("@peculiar/asn1-x509");
  7. const object_identifiers_1 = require("../object_identifiers");
  8. const algorithms_1 = require("../algorithms");
  9. class RsaEsOaepParams {
  10. hashAlgorithm = new asn1_x509_1.AlgorithmIdentifier(algorithms_1.sha1);
  11. maskGenAlgorithm = new asn1_x509_1.AlgorithmIdentifier({
  12. algorithm: object_identifiers_1.id_mgf1,
  13. parameters: asn1_schema_1.AsnConvert.serialize(algorithms_1.sha1),
  14. });
  15. pSourceAlgorithm = new asn1_x509_1.AlgorithmIdentifier(algorithms_1.pSpecifiedEmpty);
  16. constructor(params = {}) {
  17. Object.assign(this, params);
  18. }
  19. }
  20. exports.RsaEsOaepParams = RsaEsOaepParams;
  21. tslib_1.__decorate([
  22. (0, asn1_schema_1.AsnProp)({
  23. type: asn1_x509_1.AlgorithmIdentifier,
  24. context: 0,
  25. defaultValue: algorithms_1.sha1,
  26. })
  27. ], RsaEsOaepParams.prototype, "hashAlgorithm", void 0);
  28. tslib_1.__decorate([
  29. (0, asn1_schema_1.AsnProp)({
  30. type: asn1_x509_1.AlgorithmIdentifier,
  31. context: 1,
  32. defaultValue: algorithms_1.mgf1SHA1,
  33. })
  34. ], RsaEsOaepParams.prototype, "maskGenAlgorithm", void 0);
  35. tslib_1.__decorate([
  36. (0, asn1_schema_1.AsnProp)({
  37. type: asn1_x509_1.AlgorithmIdentifier,
  38. context: 2,
  39. defaultValue: algorithms_1.pSpecifiedEmpty,
  40. })
  41. ], RsaEsOaepParams.prototype, "pSourceAlgorithm", void 0);
  42. exports.RSAES_OAEP = new asn1_x509_1.AlgorithmIdentifier({
  43. algorithm: object_identifiers_1.id_RSAES_OAEP,
  44. parameters: asn1_schema_1.AsnConvert.serialize(new RsaEsOaepParams()),
  45. });