Exemplo n.º 1
0
        public async Task Add(Guid viud, BigInteger cvki, AesKey cvkiAuth, C25519Key cvkPub, Guid keyId, byte[] signature)
        {
            var payload = JsonSerializer.Serialize(new[] {
                cvkPub.ToByteArray(),
                cvki.ToByteArray(true, true),
                cvkiAuth.ToByteArray(),
                signature,
            });

            var body     = new StringContent(payload, Encoding.UTF8, "application/json");
            var response = await _client.PutAsync($"api/cvk/{viud}/{keyId}", body);

            if (response.StatusCode != HttpStatusCode.OK)
            {
                throw new HttpRequestException(response.ToString());
            }
        }