/// <summary>
        /// The exchange key.
        /// </summary>
        /// <param name="requesterDetails">
        /// The requester details.
        /// </param>
        /// <param name="ntruKey">
        /// The contact information.
        /// </param>
        /// <param name="chatPasSalt">
        /// The chat Pas Salt.
        /// </param>
        /// <returns>
        /// The <see cref="Task"/>.
        /// </returns>
        protected async Task ExchangeKey(Contact requesterDetails, IAsymmetricKey ntruKey, string chatPasSalt)
        {
            var encryptedChatPasSalt = new NtruKeyExchange(NTRUParamSets.NTRUParamNames.A2011743).Encrypt(ntruKey, Encoding.UTF8.GetBytes(chatPasSalt));

            await this.Messenger.SendMessageAsync(
                new Message(
                    MessageType.KeyExchange,
                    new TryteString(encryptedChatPasSalt.EncodeBytesAsString() + Constants.End),
                    new Address(requesterDetails.ChatKeyAddress)));
        }
        /// <inheritdoc />
        public async Task <AddContactResponse> ExecuteAsync(AddContactRequest request)
        {
            try
            {
                var contactInformation = await this.Repository.LoadContactInformationByAddressAsync(request.ContactAddress);

                var requesterDetails = new Contact
                {
                    ChatAddress      = Seed.Random().ToString(),
                    ChatKeyAddress   = Seed.Random().ToString(),
                    Name             = request.Name,
                    ImageHash        = request.ImageHash,
                    ContactAddress   = request.RequestAddress.Value,
                    Request          = true,
                    Rejected         = false,
                    NtruKey          = null,
                    PublicKeyAddress = request.PublicKeyAddress.Value
                };

                await this.Messenger.SendMessageAsync(
                    new Message(MessageType.RequestContact, TryteString.FromUtf8String(JsonConvert.SerializeObject(requesterDetails)), contactInformation.ContactAddress));

                var encryptedChatPasSalt = new NtruKeyExchange(NTRUParamSets.NTRUParamNames.A2011743).Encrypt(
                    contactInformation.NtruKey,
                    Encoding.UTF8.GetBytes(Seed.Random() + Seed.Random().ToString().Substring(0, 20)));

                await this.Messenger.SendMessageAsync(
                    new Message(
                        MessageType.KeyExchange,
                        new TryteString(encryptedChatPasSalt.EncodeBytesAsString() + Constants.End),
                        new Address(requesterDetails.ChatKeyAddress)));

                await this.Repository.AddContactAsync(requesterDetails.ChatAddress, true, requesterDetails.PublicKeyAddress);

                return(new AddContactResponse {
                    Code = ResponseCode.Success
                });
            }
            catch (MessengerException exception)
            {
                return(new AddContactResponse {
                    Code = exception.Code
                });
            }
            catch (Exception)
            {
                return(new AddContactResponse {
                    Code = ResponseCode.UnkownException
                });
            }
        }