This model is responsible for generating the information which will be added in the recovery url and for extracting the data from the recovery url.

This does not work at the moment, because we cant read / write private keys because the key-management changed.

Hierarchy (view full)

Constructors

Properties

onUpdated: OEvent<(() => void)> = ...
state: StateMachine<"Uninitialised" | "Initialised", "shutdown" | "init">

Methods

  • This is the first step in the recovery process.

    When the recovery process is started the first values that are required are the person email and the anonymous person email.

    Using the encrypted recovery information and the recovery nonce from the url and the recovery key which was entered by the user this function decrypts the person information and returns the user email and the anonymous person email.

    The decrypted data will be saved in memory until the next step in the recovery process (overwritePersonKeyWithReceivedEncryptedOnes function).

    Parameters

    • recoveryKey: string
    • recoveryNonce: HexString
    • encryptedPersonInformation: HexString

    Returns Promise<string>

  • Extract all person information and encrypt them using the recovery nonce and recovery key.

    The person private keys are decrypted before creating the person information object.

    Returns Promise<{
        encryptedPersonInformation: string;
        recoveryKey: string;
        recoveryNonce: string;
    }>

  • This is the second and last step in the recovery process. Before calling this function the decryptReceivedRecoveryInformation function should be called in order to decrypt the received data and to memorise it for this step.

    In recovery process a new person is created with the received email, but since the keys are different every time they are created, we need to overwrite the new created person keys with the old ones because the person is the same so the keys have to be the same also.

    The received person private keys are decrypted, so before memorising them we first need to encrypt the received private keys with the new password.

    The password must be set before this function is called.

    Returns Promise<void>

  • The password needs to be memorised for encrypting and decrypting private person keys.

    This will be deleted after the recovery file is created or if the model was initialised for the recovery process.

    TODO: remove me and ask the user instead. Long term storage is a bad idea!

    Parameters

    • password: string

    Returns void