private function decryptPrivateKey(PKIPrivateKey $pkiKey)
    {
        // Get the symmetric key used to encrypt the private key of the user
        $encryptedKey = base64_decode($pkiKey->getKey());

        $privateMasterKey = $this->getPrivateMasterKey();
        $symmetricKey = $this->cryptographyProvider->decryptWithPrivateKey($encryptedKey, $privateMasterKey);

        if ($symmetricKey) {
            // Decrypt the private key of the user
            $iv = $pkiKey->getIv();
            $keyData = new KeyData($symmetricKey, $iv);

            $encryptedUserPrivateKey = $pkiKey->getPrivateKey();
            $userPrivateKey = $this->cryptographyProvider->decrypt($encryptedUserPrivateKey, $keyData);

            return $userPrivateKey;
        }
        else {
            throw new EncryptionException('Could not retrieve the encryption keys of the user');
        }
    }