You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
session-desktop/ts/test/test-utils/stubs/ciphers/SecretSessionCipherStub.ts

29 lines
933 B
TypeScript

5 years ago
import { SignalService } from '../../../../protobuf';
import { CipherTextObject } from '../../../../../libtextsecure/libsignal-protocol';
import { SecretSessionCipherInterface } from '../../../../../js/modules/metadata/SecretSessionCipher';
import { StringUtils } from '../../../../session/utils';
5 years ago
export class SecretSessionCipherStub implements SecretSessionCipherInterface {
5 years ago
public async encrypt(
_destinationPubkey: string,
_senderCertificate: SignalService.SenderCertificate,
innerEncryptedMessage: CipherTextObject
): Promise<ArrayBuffer> {
const { body } = innerEncryptedMessage;
return StringUtils.encode(body, 'binary');
5 years ago
}
public async decrypt(
_cipherText: ArrayBuffer,
_me: { number: string; deviceId: number }
): Promise<{
isMe?: boolean;
sender: string;
content: ArrayBuffer;
type: SignalService.Envelope.Type;
}> {
throw new Error('Not implemented');
}
}