stores.service.js 680 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright 2018 Scytl Secure Electronic Voting SA
  3. *
  4. * All rights reserved
  5. *
  6. * See our extended copyright notice in *file 'Copyright.txt' which is part of this source code package
  7. */
  8. cryptolib.modules.stores = cryptolib.modules.stores || {};
  9. /**
  10. * A module that provides stores services.
  11. * <P>
  12. */
  13. cryptolib.modules.stores.service = function(box) {
  14. 'use strict';
  15. box.stores = box.stores || {};
  16. box.stores.service = {};
  17. var sks;
  18. cryptolib('stores.sks', function(box) {
  19. sks = box.stores.sks;
  20. });
  21. /**
  22. * @static
  23. *
  24. * @returns a Sks object.
  25. */
  26. box.stores.service.loadStore = function(store) {
  27. return new sks.SksReader(store);
  28. };
  29. };