@sebastianp265/safe-server-side-storage-client
Version:
Library for Confidential Server-Side Message Storage Using the Labyrinth Protocol
32 lines • 1.75 kB
TypeScript
import { DeviceKeyBundle, DeviceKeyBundleSerialized, DevicePublicKeyBundleSerialized } from "./key-bundles/DeviceKeyBundle";
import { Epoch, EpochStorage } from "../EpochStorage";
import { LabyrinthServerClient } from "../labyrinth-server-client";
import { VirtualDevice } from "./virtual-device/VirtualDevice";
import { OpenFirstEpochServerClient } from "../phases/open-first-epoch";
export type AuthenticateDeviceToEpochAndRegisterDeviceResponse = {
assignedDeviceId: string;
};
export type AuthenticateDeviceToEpochAndRegisterDeviceRequestBody = {
devicePublicKeyBundle: DevicePublicKeyBundleSerialized;
epochDeviceMac: string;
};
export type AuthenticateDeviceToEpochAndRegisterDeviceServerClient = {
authenticateDeviceToEpochAndRegisterDevice: (epochId: string, requestBody: AuthenticateDeviceToEpochAndRegisterDeviceRequestBody) => Promise<AuthenticateDeviceToEpochAndRegisterDeviceResponse>;
};
export type ThisDeviceSerialized = {
id: string;
keyBundle: DeviceKeyBundleSerialized;
};
export declare class ThisDevice {
readonly id: string;
readonly keyBundle: DeviceKeyBundle;
private constructor();
static deserialize(thisDeviceSerialized: ThisDeviceSerialized, epochStorage: EpochStorage, labyrinthServerClient: LabyrinthServerClient): Promise<ThisDevice>;
serialize(): ThisDeviceSerialized;
static initialize(virtualDevice: VirtualDevice, virtualDeviceDecryptionKey: Uint8Array, labyrinthWebClient: OpenFirstEpochServerClient): Promise<{
thisDevice: ThisDevice;
firstEpoch: Epoch;
}>;
static fromRecoveryCode(newestRecoveredEpoch: Epoch, webClient: AuthenticateDeviceToEpochAndRegisterDeviceServerClient): Promise<ThisDevice>;
}
//# sourceMappingURL=ThisDevice.d.ts.map