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.

11 lines
556 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. private static readonly _promiseWorker = new PromiseWorker(EncryptionServiceFactory._worker);
  8. public static getEncryptionService(): EncryptionService {
  9. return new SJCLEncryptionService(this._promiseWorker)
  10. }
  11. }