C# port of Java Security