I am just curious and experimenting with certificates in .NET Core. I am doing this to get a better understanding of the certificates I use (or should use) in .NET Core (e.g. data protection etc...)
This question showed a way to create a certificate by code.
I played around with it ended writing a cert file logging function returning me the contents of the certificate.
The code from the question sets ip adresses.
SubjectAlternativeNameBuilder sanBuilder = new SubjectAlternativeNameBuilder();
sanBuilder.AddIpAddress(IPAddress.Loopback);
sanBuilder.AddIpAddress(IPAddress.IPv6Loopback);
sanBuilder.AddDnsName("localhost");
sanBuilder.AddDnsName(Environment.MachineName);
Now there is a created X509Certificate2 with some IP adresses set but I don't find a way to get this information from the created certificate.
I also haven't found any tool showing these values.
How do I read them in order to confirm they are there?
I am trying to log all the data in a certificate and the IP addresses seem to be part of it?