session-desktop/ts/util/user.ts

18 lines
489 B
TypeScript
Raw Normal View History

import { getItemById } from '../../js/modules/data';
2020-06-09 08:18:02 +02:00
import { KeyPair } from '../../libtextsecure/libsignal-protocol';
export async function getCurrentDevicePubKey(): Promise<string | undefined> {
const item = await getItemById('number_id');
if (!item || !item.value) {
return undefined;
}
return item.value.split('.')[0];
}
export async function getIdentityKeyPair(): Promise<KeyPair | undefined> {
const item = await getItemById('identityKey');
return item?.value;
}