I want to use RSA algorithm to encrypt a string, how can I use the RSA class given in namespace System.Security.Cryptography.

How can I get the public/private key? and how to encrypt the string?

Can anyone give me a piece of code to explain this?

Thanks in advance.