How to create self sign X509Certificate

doe’s anyone have an example?
or can point me to good article ?

Check out makecert.exe

sorry for don’t explain myself
mean to do it in code

Create a process which executes makecert.exe.

thank mike,
but again I need to create this certificate with netmf on spider 2 board

You are going to have to find an open source certificate program and port it to the Micro Framework. It is not in the MF libraries…

and further, do you REALLY need to generate multiple certs on the fly from your netmf app? Can you get away with a self signed cert that you use from your code?

I don’t need to generate multiple only one, but I want to do it on the fly to keep my private key saved

?? Saved where?

Can you explain the use case you’re trying to achieve ? I’m not really sure why you would want to generate it at runtime, when generating it once off the device makes so much more sense and soooooo much easier.