Beispiel #1
0
        public async Task SetItemMetadata(string repo, string passphrase, string itemId, StoredItemMetadata meta)
        {
            var rawJson        = JsonSerializer.Serialize(meta, new() { WriteIndented = false });
            var binaryJson     = Encoding.UTF8.GetBytes(rawJson);
            var metadataPacket = crypto.PassphraseEncrypt(Encoding.UTF8.GetBytes(passphrase), binaryJson);

            var serializedPacket  = metadataPacket.ToString();
            var encryptedMetadata = Encoding.ASCII.GetBytes(serializedPacket);

            await driver.WriteMetadata(repo, itemId, encryptedMetadata);
        }