Questions tagged [cer]

In .NET Framework, a constrained execution region (CER) defines an area in which the common language runtime (CLR) is constrained from throwing out-of-band exceptions that would prevent the code in the area from executing in its entirety.

A constrained execution region (CER) is part of a mechanism for authoring reliable managed code. A CER defines an area in which the common language runtime (CLR) is constrained from throwing out-of-band exceptions that would prevent the code in the area from executing in its entirety. Within that region, user code is constrained from executing code that would result in the throwing of out-of-band exceptions. (Excerpt from the MSDN library)

56 questions
3
votes
1 answer

Understanding the purpose of CERs in this example

I'm reading through Constrained Execution Regions and other errata [Brian Grunkemeyer] in an attempt to understand constrained execution regions, however I'm having some problems understanding the following…
Justin
  • 84,773
  • 49
  • 224
  • 367
3
votes
2 answers

Do static constructors run as CERs?

I'm testing the below code: private static void Main() { var t = new Thread(() => { var m = new MyCls(); m.DoWork(); }); t.Start(); // simulate time-consuming job Thread.Sleep(1000); t.Abort(); …
KeyBored
  • 601
  • 4
  • 14
3
votes
3 answers

using constrained execute regions

I have a Visual Studio 2008 C# .NET 3.5 application that P/Invokes a native method that accepts a file handle as a parameter. Originally, I was just using FileStream.SafeFileHandle.DangerousGetHandle() to get the file handle. But, after turning on…
PaulH
  • 7,759
  • 8
  • 66
  • 143
3
votes
3 answers

exporting a public key in pem format from x509certificate2 object

I'm new to this subject, and I got confused of the differences between a public key in PEM format vs CER format. I'm trying to export a public key from a x509certificate2 object in PEM format in c# code. As far as I understand, the difference…
3
votes
1 answer

ssl with self signed certificate using python

I am trying to build a simple server in python using my self signed certificate. I created .cer, .pfx, .pvk files using makecert. context =…
J. Doe
  • 33
  • 1
  • 3
3
votes
0 answers

Does DangerousAddRef keep the whole SafeHandle alive or just the handle?

I am in the situation where I have a c# object containing an HGLOBAL and a List. The HGLOBAL holds references to the delegates and the HGLOBAL is registered in unmanaged code as a callback (specifically, a vtbl-style interface). I'm…
2
votes
1 answer

Install certificate .cer and pfx on setup desktop program c#

how can i install two certificates (pfx with password) during my setup is installing on pc? I need Two certificates located on personal->certificates because desktop program is used for all users on this pc. I'm using .net 3.5 Thanks.
user3486836
  • 163
  • 1
  • 1
  • 7
2
votes
2 answers

OpenSSL RSA extract public key with .cer format

I'm using openSSL to create RSA public and private key. I create success, and output is 2 keys with format private_key.pem and public_key.pem. So, the requirement is public key need to be in .cer extension, Base 64 format and start with header:…
Tran Tam
  • 699
  • 3
  • 14
  • 27
2
votes
2 answers

Install .cer certificates debian

I have to install a certificates on my server, but they only gave me a .cer file. I search on some forums, but I don't find anything to install it, just for .crt files... How could I install it ? Thanks a lot
Nathan30
  • 689
  • 2
  • 8
  • 29
2
votes
1 answer

How to convert a p12 file into gateway.jks,cacerts.jks

In my glassfish config file there are 3 key files gateway.jks,cacerts.jks,HOST1.cer. For connecting the the application to remote server the server team provides a .p12 file .I converted that .p12 file to private and public key pair. But unable to…
php- web
  • 75
  • 1
  • 11
2
votes
3 answers

Export APNs certificate as a p12 file

I'm trying to export the APNs certificate as a .p12 file. but, after I double click on the .cer file, I can't find it under "My Certificates", and I'm not allowed to export it as .p12 file (but .cer, .pem, p7b). why? I created this certificate on…
Meniny
  • 660
  • 8
  • 22
2
votes
4 answers

how to add/convert certificate file into pkcs12 file

I have received the three certificates(.CER files) to access the production server. How I am going to add/convert these certificates into PKCS12 file.
Rohit
  • 445
  • 2
  • 7
  • 17
1
vote
1 answer

Get "The server mode SSL must use a certificate with the associated private key." error in X509Certificate2 by use .cer instead of .pfx

I use .cer and .key files in custom web server for validate ssl with SslStream.AuthenticateAsServerAsync(). creating process of X509Certificate2 is some things like this: var bytes = File.ReadAllBytes(certificatePath); using var publicKey = new…
Ali Qamsari
  • 93
  • 1
  • 10
1
vote
2 answers

Why PrepareConstrainedRegions method does not work in c#?

I read the book "CLR via C#" by Jeffrey Richter. In chapter 20, there is a code example demonstrating usage of Constrained Execution Regions (CERs): private static void Demo2() { // Force the code in the finally to be eagerly prepared …
helgez
  • 157
  • 1
  • 7
1
vote
1 answer

How create a pem file with nodes

im working with a web application for some client who needs sign some documents other company give him 2 files - file1.key - file2.cer if im understand thus files are encrypted with a password so the user needs his password the company give me some…