Moved encryption service to common
This commit is contained in:
parent
944377f111
commit
e06d98752a
@ -1,5 +1,5 @@
|
|||||||
import { EncryptionService } from "./EncryptionService";
|
import { EncryptionService } from "../../common/service/EncryptionService";
|
||||||
import { SJCLEncryptionService } from "./SJCLEncryptionService";
|
import { SJCLEncryptionService } from "../../common/service/SJCLEncryptionService";
|
||||||
// import PromiseWorker = require('promise-worker');
|
// import PromiseWorker = require('promise-worker');
|
||||||
import PromiseWorker from "promise-worker";
|
import PromiseWorker from "promise-worker";
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import { ChatMessageDTO } from "../dto/ChatMessageDTO";
|
|||||||
import { MessageCipherDTO } from "../dto/MessageCipherDTO";
|
import { MessageCipherDTO } from "../dto/MessageCipherDTO";
|
||||||
import { ChatModel } from "../../common/model/ChatModel";
|
import { ChatModel } from "../../common/model/ChatModel";
|
||||||
import { Observer } from "../observe/Observer";
|
import { Observer } from "../observe/Observer";
|
||||||
import { EncryptionService } from "../service/EncryptionService";
|
import { EncryptionService } from "../../common/service/EncryptionService";
|
||||||
import { MarkDownService } from "../service/MarkDownService";
|
import { MarkDownService } from "../service/MarkDownService";
|
||||||
import { JsonAPI } from "../singleton/JsonAPI";
|
import { JsonAPI } from "../singleton/JsonAPI";
|
||||||
import { ChatMessageViewModel } from "../viewmodel/ChatMessageViewModel";
|
import { ChatMessageViewModel } from "../viewmodel/ChatMessageViewModel";
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { ChatMessageViewModel } from "../viewmodel/ChatMessageViewModel";
|
import { ChatMessageViewModel } from "../viewmodel/ChatMessageViewModel";
|
||||||
import { ChatModel } from "../../common/model/ChatModel";
|
import { ChatModel } from "../../common/model/ChatModel";
|
||||||
import { MarkDownService } from "../service/MarkDownService";
|
import { MarkDownService } from "../service/MarkDownService";
|
||||||
import { EncryptionService } from "../service/EncryptionService";
|
import { EncryptionService } from "../../common/service/EncryptionService";
|
||||||
import { NotificationService } from "../service/NotificationService";
|
import { NotificationService } from "../service/NotificationService";
|
||||||
import { UserModel } from "../../common/model/UserModel";
|
import { UserModel } from "../../common/model/UserModel";
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import * as log from "loglevel";
|
import * as log from "loglevel";
|
||||||
import { ChatMessageDTO } from "../../chat/dto/ChatMessageDTO";
|
import { ChatMessageDTO } from "../../chat/dto/ChatMessageDTO";
|
||||||
import { EncryptionService } from "../../chat/service/EncryptionService";
|
import { EncryptionService } from "../service/EncryptionService";
|
||||||
import { NotificationService } from "../../chat/service/NotificationService";
|
import { NotificationService } from "../../chat/service/NotificationService";
|
||||||
import { JsonAPI } from "../../chat/singleton/JsonAPI";
|
import { JsonAPI } from "../../chat/singleton/JsonAPI";
|
||||||
import { Sprintf } from "../../chat/singleton/Sprintf";
|
import { Sprintf } from "../../chat/singleton/Sprintf";
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { MessageCipherDTO } from "../dto/MessageCipherDTO";
|
import { MessageCipherDTO } from "../../chat/dto/MessageCipherDTO";
|
||||||
|
|
||||||
export interface EncryptionService {
|
export interface EncryptionService {
|
||||||
encrypt(passphrase: string, plainText: string): any;
|
encrypt(passphrase: string, plainText: string): any;
|
@ -1,6 +1,6 @@
|
|||||||
import { EncryptionService } from "./EncryptionService";
|
import { EncryptionService } from "./EncryptionService";
|
||||||
import * as sjcl from "sjcl";
|
import * as sjcl from "sjcl";
|
||||||
import { MessageCipherDTO } from "../dto/MessageCipherDTO";
|
import { MessageCipherDTO } from "../../chat/dto/MessageCipherDTO";
|
||||||
import PromiseWorker from "promise-worker";
|
import PromiseWorker from "promise-worker";
|
||||||
export class SJCLEncryptionService implements EncryptionService {
|
export class SJCLEncryptionService implements EncryptionService {
|
||||||
private _params: sjcl.SjclCipherParams = { mode: "gcm", ts: 128, adata: "", iter: 10000 };
|
private _params: sjcl.SjclCipherParams = { mode: "gcm", ts: 128, adata: "", iter: 10000 };
|
Loading…
Reference in New Issue
Block a user