public async Task <StoredItemMetadata> GetItemMetadata(string repo, string passphrase, string itemId) { var encryptedMetadata = await driver.ReadMetadata(repo, itemId); var serializedPacket = Encoding.ASCII.GetString(encryptedMetadata); var encodedPassphrase = Encoding.UTF8.GetBytes(passphrase); var packet = PassphraseEncryptedPacket.FromString(encodedPassphrase, serializedPacket); var binaryMetadata = crypto.PassphraseDecrypt(encodedPassphrase, packet); var rawJson = Encoding.UTF8.GetString(binaryMetadata); return(JsonSerializer.Deserialize <StoredItemMetadata>(rawJson)); }