Exemplo n.º 1
0
 internal static extern bool FriendGetPublicKey(ToxHandle tox, uint friendNumber, byte[] publicKey, ref ToxErrorFriendGetPublicKey error);
Exemplo n.º 2
0
        /// <summary>
        /// Retrieves a friend's public key.
        /// </summary>
        /// <param name="friendNumber">The friend number to retrieve the public key of.</param>
        /// <param name="error"></param>
        /// <returns>The friend's public key on success.</returns>
        public ToxKey GetFriendPublicKey(int friendNumber, out ToxErrorFriendGetPublicKey error)
        {
            ThrowIfDisposed();

            byte[] address = new byte[ToxConstants.PublicKeySize];
            error = ToxErrorFriendGetPublicKey.Ok;

            if (!ToxFunctions.FriendGetPublicKey(_tox, (uint)friendNumber, address, ref error))
                return null;

            return new ToxKey(ToxKeyType.Public, address);
        }
Exemplo n.º 3
0
 internal static extern bool FriendGetPublicKey(ToxHandle tox, uint friendNumber, byte[] publicKey, ref ToxErrorFriendGetPublicKey error);
Exemplo n.º 4
0
 public static extern Boolean GetPublicKey(ToxHandle tox, UInt32 friendNumber, Byte[] publicKey, ref ToxErrorFriendGetPublicKey error);