Code demonstrating the importance of a Constrained Execution Region

using System; using System.Runtime.CompilerServices; using System.Runtime.ConstrainedExecution; class Program { static bool cerWorked; static void Main( string[] args ) { try { cerWorked = true; MyFn(); } catch( OutOfMemoryException ) { Console.WriteLine( cerWorked ); } Console.ReadLine(); } unsafe struct Big { public fixed byte Bytes[int.MaxValue]; } //results depends on the existance of this attribute [ReliabilityContract( Consistency.WillNotCorruptState, … Read more

How to extract the RSA public key from a .cer and store it in a .pem using OpenSSL?

Using this command I was able to generate the .pem with the contents of the public key. openssl x509 -inform der -in certificate.cer -pubkey -noout > certificate_publickey.pem Which produces: —–BEGIN PUBLIC KEY—– MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCsM+whXrxmbCkPfkwY2EehYpIp *blah blah blah blah* —–END PUBLIC KEY—–