private function storeKeyPair($publicKey, $privateKey, $usedForPasswords)
    {
        $publicKeyFingerprint = $this->getFingerprintByPublicKey($publicKey->getKeyString());

        $keyPair = [];
        $keyPair['publicKey'] = $publicKey;
        $keyPair['privateKey'] = $privateKey;
        $keyPair['usedForPasswords'] = $usedForPasswords;

        $this->keys[$publicKeyFingerprint] = $keyPair;
        $this->saveKeysOnShutdown = true;

        return $publicKeyFingerprint;
    }