The first step is to create a pair of key(pulic/private): RSACryptoServiceProvider RSA = new RSACryptoServiceProvider(); string publicKey = RSA.ToXmlString(false); string privateKey = RSA.ToXmlString(true); Private key is required to sign the string.