A self hosted chat application with end-to-end encrypted messaging.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
574 B

  1. import { EncryptionService } from "./EncryptionService";
  2. import { SJCLEncryptionService } from "./SJCLEncryptionService";
  3. import PromiseWorker = require('promise-worker');
  4. // import PromiseWorker from "promise-worker";
  5. export class EncryptionServiceFactory {
  6. private static readonly _worker = new Worker('/js/worker.js');
  7. // @ts-ignore
  8. private static readonly _promiseWorker = new PromiseWorker(EncryptionServiceFactory._worker);
  9. public static getEncryptionService(): EncryptionService {
  10. return new SJCLEncryptionService(this._promiseWorker)
  11. }
  12. }