You could use a ready-made tool:
6 Best Tools to Help You Convert Java to C# Source Code » CODECALL[
^]
...or you could be a programmer and do it manually. It really isn't that tough. Most of Java even uses some of the same class names. The only thing you'd have to be concerned with are namespaces and java-specific keywords, like
final
(as seen in your sample).
BTW, a question regarding generating encryption keys was asked a day or three ago, and I posted a C#-specific answer that actually contained code. You would do well to search for it, and forget this java nonsense.