public async Task <(byte[] Token, C25519Cipher Challenge)> Challenge(Guid viud, Guid keyId) { var response = await _client.GetAsync($"api/cvk/challenge/{viud}/{keyId}"); if (response.StatusCode != HttpStatusCode.OK) { throw new HttpRequestException(response.ToString()); } var res = JsonSerializer.Deserialize <Dictionary <string, byte[]> >(await response.Content.ReadAsStringAsync()); return(res["token"], C25519Cipher.Parse(res["challenge"])); }
public static C25519Point GetCipherC1(byte[] dataBuffer) { return(C25519Cipher.Parse(dataBuffer.Take(EncryptionSize).ToArray()).C1); }
public static C25519Cipher CipherFromAsymmetric(byte [] data) { return(C25519Cipher.Parse(data.Take(32 * 3).ToArray())); }