Does anyone know of a simple tutorial or sample code of how to sign data in c# using bouncy castle. In Java there are tons of tutorials and samples. I can\'t find a single e
Look at Bouncy Castle web site. There is archive with sources and examples. http://www.bouncycastle.org/csharp/download/bccrypto-net-1.7-src-ext.zip
As a examples there are a lot of NUnit tests. Below is code of method to encrypt data byte array using RSA algorithm as a sample, but in Bouncy Castle sources and tests you can find more samples.
public static byte[] Encrypt(byte[] data, AsymmetricKeyParameter key)
{
RsaEngine e = new RsaEngine();
e.Init(true, key);
int blockSize = e.GetInputBlockSize();
List output = new List();
for (int chunkPosition = 0; chunkPosition < data.Length; chunkPosition += blockSize)
{
int chunkSize = Math.Min(blockSize, data.Length - (chunkPosition * blockSize));
output.AddRange(e.ProcessBlock(data, chunkPosition, chunkSize));
}
return output.ToArray();
}