public async Task <ResultWrapper <bool> > vault_verifySignature( string vaultId, string keyId, string message, string signature) { try { bool result = await _vaultService.Verify(Guid.Parse(vaultId), Guid.Parse(keyId), message, signature); return(ResultWrapper <bool> .Success(result)); } catch (Exception e) { return(ResultWrapper <bool> .Fail(e)); } }
public async Task <bool> Verify(Address address, Keccak message, Signature signature) { if (address is null) { throw new ArgumentNullException(nameof(address)); } if (signature is null) { throw new ArgumentNullException(nameof(signature)); } Guid?keyId = await RetrieveId(address); if (keyId is null) { throw new KeyNotFoundException($"Account with the given address {address} could not be found"); } string sig = Convert.ToString(signature) !.Remove(0, 2); bool result = await _vaultService.Verify(_vaultId, keyId.Value, message.ToString(), sig); return(result); }