import * as proto from "../../proto/message"; import { Decoder, Encoder, Message, ProtoMessage } from "../interfaces"; import { DecoderV0, MessageV0 } from "./version_0"; export declare const Version = 1; export declare type Signature = { signature: Uint8Array; publicKey: Uint8Array | undefined; }; export declare class MessageV1 extends MessageV0 implements Message { signature?: Uint8Array | undefined; signaturePublicKey?: Uint8Array | undefined; private readonly _decodedPayload; constructor(proto: proto.WakuMessage, decodedPayload: Uint8Array, signature?: Uint8Array | undefined, signaturePublicKey?: Uint8Array | undefined); get payload(): Uint8Array; } export declare class AsymEncoder implements Encoder { contentTopic: string; private publicKey; private sigPrivKey?; constructor(contentTopic: string, publicKey: Uint8Array, sigPrivKey?: Uint8Array | undefined); toWire(message: Partial): Promise; toProtoObj(message: Partial): Promise; } export declare class SymEncoder implements Encoder { contentTopic: string; private symKey; private sigPrivKey?; constructor(contentTopic: string, symKey: Uint8Array, sigPrivKey?: Uint8Array | undefined); toWire(message: Partial): Promise; toProtoObj(message: Partial): Promise; } export declare class AsymDecoder extends DecoderV0 implements Decoder { private privateKey; constructor(contentTopic: string, privateKey: Uint8Array); fromProtoObj(protoMessage: ProtoMessage): Promise; } export declare class SymDecoder extends DecoderV0 implements Decoder { private symKey; constructor(contentTopic: string, symKey: Uint8Array); fromProtoObj(protoMessage: ProtoMessage): Promise; } /** * Proceed with Asymmetric encryption of the data as per [26/WAKU-PAYLOAD](https://rfc.vac.dev/spec/26/). * The data MUST be flags | payload-length | payload | [signature]. * The returned result can be set to `WakuMessage.payload`. * * @internal */ export declare function encryptAsymmetric(data: Uint8Array, publicKey: Uint8Array | string): Promise; /** * Proceed with Asymmetric decryption of the data as per [26/WAKU-PAYLOAD](https://rfc.vac.dev/spec/26/). * The returned data is expected to be `flags | payload-length | payload | [signature]`. * * @internal */ export declare function decryptAsymmetric(payload: Uint8Array, privKey: Uint8Array): Promise; /** * Proceed with Symmetric encryption of the data as per [26/WAKU-PAYLOAD](https://rfc.vac.dev/spec/26/). * * @param data The data to encrypt, expected to be `flags | payload-length | payload | [signature]`. * @param key The key to use for encryption. * @returns The decrypted data, `cipherText | tag | iv` and can be set to `WakuMessage.payload`. * * @internal */ export declare function encryptSymmetric(data: Uint8Array, key: Uint8Array | string): Promise; /** * Proceed with Symmetric decryption of the data as per [26/WAKU-PAYLOAD](https://rfc.vac.dev/spec/26/). * * @param payload The cipher data, it is expected to be `cipherText | tag | iv`. * @param key The key to use for decryption. * @returns The decrypted data, expected to be `flags | payload-length | payload | [signature]`. * * @internal */ export declare function decryptSymmetric(payload: Uint8Array, key: Uint8Array | string): Promise; /** * Prepare the payload pre-encryption. * * @internal * @returns The encoded payload, ready for encryption using {@link encryptAsymmetric} * or {@link encryptSymmetric}. */ export declare function preCipher(messagePayload: Uint8Array, sigPrivKey?: Uint8Array): Promise; /** * Decode a decrypted payload. * * @internal */ export declare function postCipher(message: Uint8Array): { payload: Uint8Array; sig?: Signature; } | undefined;