rsaes_oaep.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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, context: 0, defaultValue: algorithms_1.sha1,
  24. })
  25. ], RsaEsOaepParams.prototype, "hashAlgorithm", void 0);
  26. tslib_1.__decorate([
  27. (0, asn1_schema_1.AsnProp)({
  28. type: asn1_x509_1.AlgorithmIdentifier, context: 1, defaultValue: algorithms_1.mgf1SHA1,
  29. })
  30. ], RsaEsOaepParams.prototype, "maskGenAlgorithm", void 0);
  31. tslib_1.__decorate([
  32. (0, asn1_schema_1.AsnProp)({
  33. type: asn1_x509_1.AlgorithmIdentifier, context: 2, defaultValue: algorithms_1.pSpecifiedEmpty,
  34. })
  35. ], RsaEsOaepParams.prototype, "pSourceAlgorithm", void 0);
  36. exports.RSAES_OAEP = new asn1_x509_1.AlgorithmIdentifier({
  37. algorithm: object_identifiers_1.id_RSAES_OAEP,
  38. parameters: asn1_schema_1.AsnConvert.serialize(new RsaEsOaepParams()),
  39. });