Quantcast
Channel: Rebex Q&A Forum - Recent questions and answers
Viewing all 3870 articles
Browse latest View live

Answered: how to convert rebex windows library to native library which will support mono on linux?

$
0
0

All Rebex component DLLs are managed .NET assemblies that can be used by .NET applications which run on Common Language Runtime (CLR) virtual machine such .NET Framework, .NET Core or Mono.

On Linux, you can use Mono or .NET Core to create applications that use Rebex DLLs.

Please note that ".NET 4.0" versions of Rebex DLLs are suitable for Mono on Linux (in addition to .NET Framework 4.x on Windows), and ".NET Standard 1.5" versions of Rebex DLLs are suitable for .NET Core 1.1 and .NET Core 2.0 (on Linux, Windows and macOS).


Answered: Can I use Rebex.Common.dll directly on mono?

$
0
0

It's the same as using Mono itself - write an application (using C# or another .NET language), compile it and run it. There are IDEs that simplify this process, such as Visual Studio (Windows-only), VS Code or MonoDevelop.

For example, the following application would generate an RSA key and save it's private and public keys to mykey.pri and mykey.pub files:

using System;
using Rebex.Security.Cryptography;
using Rebex.Security.Cryptography.Pkcs;

namespace Rebex.Samples
{
    public class Program
    {
        public static void Main(string[] args)
        {
            Console.WriteLine("Generating RSA private key...");

            // create an instance of AsymmetricKeyAlgorithm
            var alg = new AsymmetricKeyAlgorithm();

            // generate a 2048-bit RSA key pair
            alg.GenerateKey(AsymmetricKeyAlgorithmId.RSA, 2048);

            // retrieve and save the private key in new OpenSSH format
            PrivateKeyInfo privateKey = alg.GetPrivateKey();
            privateKey.Save("mykey.pri", "password", PrivateKeyFormat.NewOpenSsh);

            PublicKeyInfo publicKey = alg.GetPublicKey();
            publicKey.Save("mykey.pub");

            Console.WriteLine("Done.");
        }
    }
}

To use this in .NET or Mono, you first have to compile the application. Mono C# compiler is executed using mcs command, which accepts list of source code files and references:

mcs Program.cs -r:Rebex.Common.dll

Running this would produce Program.exe. To run this on Linux, use mono command:

mono Program.exe

Alternatively, use mkbundle to create a native executable.

How Rebex has managed P/Invoke dependencies on Mono?

$
0
0

How Rebex has managed P/Invoke dependencies on Windows native libraries when I am going to use same windows rebex dll on Mono?

There are lot of source code for Rebex.

1) vs2008-net-2.0
2) vs2008-netcf-2.0
3) vs2008-netcf-3.5
4) vs2010-net-4.0
5) vs2012-netcf-3.9
6) vs2012-rt-8.0
7) vs2012-rt-8.1
8) vs2015-uwp-10

Which source I need to use for mono for linux?

Can I cancel transfer the GetFile(name, stream)/GetDownloadStream functions with keeping the connection in ftp?

$
0
0

While GetFile(name, stream) function running,
I want to cancel download only.
But I guess that ftp.Abort() function drops main control connection.
(next ftp.GetFile() raise 'Not connected to the server' exception.)
I want to keep main control connection and only cancel current download.

Thank you.
(Sorry my poor English)

Answered: How Rebex has managed P/Invoke dependencies on Mono?

$
0
0

You need to use the source code in vs2010-net-4.0 folder. It targets .NET 4.0, .NET 4.5.x, .NET 4.6.x, .NET 4.7 and Mono (3.0 or higher).

The vs2008-net-2.0 folder contains source code targeting .NET 2.0, .NET 3.0, .NET 3.5 and Mono 3.x (in .NET 2.0 mode).

The P/Invokes to Windows native libraries are only used when running on Windows.

As a side note, we are currently working on adding Mono support to .NET Standard 1.5 version of Rebex DLLs. This might be the preferred option because those DLLs are also going to support .NET Core (on Linux, Windows and macOS). If you would like rather use this, please contact us at support@rebex.net.

Top 10 Things detest About Porn

$
0
0
We know you'd in order to watch your favorite porn off the hustle and bustle of one's desk or home Pc. Watching fast porn movies on your iPhone is so very much more private talk about their experience now enjoy thousands of mobile video tutorials and daily updates without notice to, wherever you happen to be!

Firstly, it appears down into the way you were brought to the peak. If you grew up in a puritanical household where all mention of sex and sexuality was taboo, want will a great inbuilt inclination to be quiet during intercourse, and be very reserved whenever it comes to vocalizing producing love.

Sadly, there is not much could do using this guy, and it has not do with his race. Many young men born fast porn movies their 1980s/1990s are learning about sex and feminine sexuality through their being exposed to pornography. Since the porn market is about entertainment and fast porn movies fulfilling male fantasies about sex, it is no more realistic than see a movie like Harry Potter, or just a video field.

image

There are a couple programs which permit you to remove RealPlayer Porn Files from both your online and offline PC activities on an immutable basis. Usually, these programs have unlimited usage meaning you don't need to keep on installing the blasted software after its trial version is burned up.

When it will come to gambling, I just have one question for you, have you ever been in the corner of Coit and Cambell, created a left turn? Believe me you are gambling, avoid your money, but with your life! An individual ever driven up the Toll-way during rush moment? You are gambling when ever you get yourself into a motor. Who am I hurting if I sit down at a texas holdem table and play, my loved ones? What should I be doing with my money instead, buy beer and cigarettes, take skydiving lessons? So I grasp the rules Previously Dallas Fort Worth Metroplex: I spend to jump out within a plane, purchase wine and cigars, pay money to discover naked women dance, rent xxx movies, bungee jump from any tower, shoot people with paint balls in a mock war, but Not able to sit down and play fast porn movies a card game?

Some women (and men) believe that the gushing orgasm is a myth - or quite that it's very not easily achieved. Every woman's is different; however, all for women who live the capability to squirt. Anyone have or your partner wants obtain this involving orgasm, wide selection few ways where it is make it simpler to ensue.

Being the male within a room with a bevy of women gives me an indescribable fast porn movies feeling. One, an anticipation of a fuck fest and the opposite one being dejected by all them in might turn to be able to be a sexual demonstration. While an anal pornjust.net were being played I attempted to cozy up again with the beach blond, but she shied away, in a way in which flatly turning me upon the chance getting laid tonight. Disappointed by the sudden turn of events, I went for walk and ran into Kiya, a Japanese American who stays in precisely the same building.

Are there any real rules occasions to successful penis male enlargement? Really are the methods or mantra's followed by those sufferers who get GREAT gains from your house? Are there any involving enhancement exercise to Bypass.and if so what are they?Most men feel insecure fast porn movies when they perceive which have a small penis. That makes it important to assist keep a man's penis great shape as it is what determines his masculinity.

Encryption UWP web Api Rebex.Legacy.Cryptography

$
0
0

Hello, i was trying to encrypt file(byte array) in UWP application with help of Rebex.Legacy.Cryptography class and decrypt byte array at the server side(web api) with help of System.Security.Cryptography. But every time when i try to decrypt array i receive an error "The input is not a complete block".

my code

AesCryptoServiceProvider aes;
    // Key with 256 and IV with 16 length
    private string AES_Key = "password";

singletone

private RabexEnc()
    {
        aes = new AesCryptoServiceProvider();
        aes.Mode = CipherMode.CBC;
        aes.Padding = PaddingMode.PKCS7;

        // generate symmetric key and initialization vector
        aes.GenerateIV();
        byte[] IV = aes.IV;
        //The Salt will be the first 8 bytes of the IV.
        byte[] theSalt = new byte[8];
        Array.Copy(IV, theSalt, 8);
        //A key for AES is generated by expanding the password using the following method.
        Rfc2898DeriveBytes keyGen = new Rfc2898DeriveBytes(AES_Key, theSalt);
        byte[] aesKey = keyGen.GetBytes(16);
        aes.Key = aesKey;
    }

public byte[] Encrypt_Aes(byte[] streamBytes)
    {
        // create an instance of memory-based stream to hold encrypted data
        var ms = new MemoryStream();

        // Create a decrytor to perform the stream transform.
        ICryptoTransform encryptor = aes.CreateEncryptor(aes.Key, aes.IV);
        // create an encryptor, create a CryptoStream and wrap a StreamWriter around it
        using (var cs = new CryptoStream(ms, aes.CreateEncryptor(), CryptoStreamMode.Write))
        {
            cs.Write(streamBytes, 0, streamBytes.Length);
        }

        return ms.ToArray();
    }

    public byte[] Decrypt_Aes(byte[] streamBytes)
    {
        // create an instance of memory-based stream to hold encrypted data
        var ms = new MemoryStream();

        using (MemoryStream msDecrypt = new MemoryStream(streamBytes))
        {
            // Create a decrytor to perform the stream transform.
            ICryptoTransform decryptor = aes.CreateDecryptor(aes.Key, aes.IV);

            using (CryptoStream csDecrypt = new CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Read))
            {
                using (MemoryStream newstream = new MemoryStream())
                {
                    csDecrypt.CopyTo(newstream);
                    return newstream.ToArray();
                }
            }
        }
    }

Same code working at the server, but namespace at the server set to System.Security.Cryptography instead of Rebex.Legacy.Cryptography. Thanks for a reply.

HttpRequest OutOfMemoryException on Windows CE

$
0
0

I am trying to use HttpRequest to stream large files to a web api from a limited memory Windows CE device. The exception is thrown while writing to the request stream. The same problem is not encountered when using HttpWebRequest. I am attempting to use HttpRequest for its TLS support.

Is HttpRequest buffering the content stream? Is there any way to mimic the functionality of HttpWebRequest's AllowWriteStreamBuffering=false or SendChunked=true?

The code is roughly as follows:

string formDataBoundary = String.Format("----------{0:N}", Guid.NewGuid());
var webRequest = DdfWebRequest.Create(postUrl);
webRequest.ContentType = "multipart/form-data; boundary=" + formDataBoundary;
webRequest.Method = "POST";

// Determine the ContentLength before opening the request stream              
//webRequest.ContentLength = DetermineStreamSize(reportFiles);

// Write form and file data to request stream
using (Stream requestStream = webRequest.GetRequestStream())
{
    string fd;
    foreach (string reportFile in reportFiles)
    {
        fd = string.Format("--{0}\r\nContent-Disposition: form-data; name=\"{1}\"; filename=\"{2}\"\r\n\r\n", formDataBoundary,
                                   reportId.ToString(), Path.GetFileName(reportFile));
        requestStream.Write(Encoding.UTF8.GetBytes(fd), 0, Encoding.UTF8.GetByteCount(fd));

        // Get the file content
        FileStream fs = new FileStream(reportFile, FileMode.Open, FileAccess.Read);
        byte[] data = new byte[2048];
        int k = 0;
        for (int i = 0; i < fs.Length; i+=k)
        {
            k = fs.Read(data, 0, data.Length);
            if (k > 0)
            {
                requestStream.Write(data, 0, k);
            }
        }
        fs.Close();
        requestStream.Write(Encoding.UTF8.GetBytes("\r\n"), 0, 2);
    }
    // Add last boundary
    string footer = "\r\n--" + formDataBoundary + "--\r\n";
    requestStream.Write(Encoding.UTF8.GetBytes(footer), 0, Encoding.UTF8.GetByteCount(footer));
    requestStream.Flush();
    requestStream.Close();
}

// Get the response from the JetLink
HttpResponse webResponse = (HttpResponse)webRequest.GetResponse();


// Get the response from the JetLink
HttpResponse webResponse = (HttpResponse)webRequest.GetResponse();

Answered: Bind FTP client to Terminal

$
0
0

No, it is not possible. Actually, it wouldn't work as you are probably expecting.

Please note that FTP protocol is very specific. It uses control connection, which can be used in plain Telnet. And for file uploads, downloads and directory listing the FTP protocol uses data connection. For each transfer, new data connection is established.

If you bind the Terminal control to well configured Telnet, you can script control connection. But you wouldn't be possible to create data connections. Which means you wouldn't be able to transfer any file or list directories.

You can try it like this:

var telnet = new Telnet("test.rebex.net", 21);
terminal.Options.NewLineSequence = NewLineSequence.CRLF;
terminal.Options.LocalEcho = true;
terminal.Bind(telnet);

Then type:

USER demo
PASS password
FEAT

I suppose that you basically want to script classic "Console" ftp command line application such as MSFTP. Am I right?

This could be possible if you write your own IShellChannelFactory respectively ShellChannel to transport data.

Answered: Update mail subject imap issue

Answered: Encryption UWP web Api Rebex.Legacy.Cryptography

Signer certificate in EML file

$
0
0

Rebex component can still validate the signature and find the signer certificate of signed-only EML file; although the certificate was deleted from Windows certificate stores. Does that mean the signer certificates are embedded within the EML files? If not, how can Rebex find it?

Sincerely,

load a Rebex.totalpack.dll is taking one minute first time. second time it works fine

$
0
0

Suppose we have two method A and B and A is Calling B. B has Rebex SMTP class and its method. Once we setup SMTP server first time then A calls B. First time its taking 1 minute to enter into B method and execute first line of B method. Any specific reason? Rebex.Total.dll size is 2.01 MB.

Please guide further to resolve this issue.

Answered: Signer certificate in EML file

$
0
0

Yes, the signed mail really does contain the signer's certificate, but only the public part (private key is not included). So, everyone can validate the signature using embedded public key. This implies that the signer has access to corresponding private key.

best way to use rebex dlls

$
0
0

can we do ILMerging of all dll into signle dll and use class and methods of Rebex? or what is best way to call methods of Rebex in our projects?


Answered: HttpRequest OutOfMemoryException on Windows CE

$
0
0

Unfortunately, on-the-fly uploads (AllowWriteStreamBuffering=false) and chunked upload mode (SendChunked=true) are not implemented yet. Sorry!

However, these features are currently on top of our list of enhancements and will appear in one of the next releases.

We currently have a partially-finished beta that implements AllowWriteStreamBuffering=false. When we add SendChunked=true as well, I'll send you a link to a beta package to try.

Answered: Encryption Web Api Rebex.Legacy.Cryptography

$
0
0

Hello, thanks for the clarification.

We have tried to reproduce the issue this way and noticed that that you might be generating different initialization vector in the UWP app and in the server app, which would return different salt at the decrypting end. This would explain the error.

When we use the same IV/salt at the server side, the process works fine - download the updated sample solution and give it a try.

If you are doing anything differently, please let us know.

Will vs2008-net-2.0 will support Mono 4.8 also?

$
0
0

Will vs2008-net-2.0 will support Mono 4.8 also?

How to use wildcard with GetList with a folder with more than 10000 items

$
0
0

Hi,

When a folder has more than 10000 files, GetList returns only the 10000 first. The file I need might not be in the 10000 first files so I want to use a wildcard.

The thing is that when I use a wildcard, it returns 0 files. The wildcard is perfectly valid and when I remove enough file to be under the 10000 limit, the file is returned properly with the wildcard.

How can I solve that problem ? Thanks

best way to use rebex dlls

$
0
0

can we do ILMerging of all dll into signle dll and use class and methods of Rebex? or what is best way to call methods of Rebex in our projects?

Viewing all 3870 articles
Browse latest View live