Skip to content

Commit eb7588a

Browse files
Remove .Import method (#9807)
1 parent 0c096a3 commit eb7588a

File tree

1 file changed

+2
-3
lines changed
  • snippets/csharp/System.Security.Cryptography.X509Certificates/PublicKey/Overview

1 file changed

+2
-3
lines changed

snippets/csharp/System.Security.Cryptography.X509Certificates/PublicKey/Overview/certinfo.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,9 @@ static void Main(string[] args)
2828
}
2929
try
3030
{
31-
X509Certificate2 x509 = new X509Certificate2();
32-
//Create X509Certificate2 object from .cer file.
3331
byte[] rawData = ReadFile(args[0]);
34-
x509.Import(rawData);
32+
//Create X509Certificate2 object from .cer file.
33+
X509Certificate2 x509 = new X509Certificate2(rawData);
3534

3635
//Print to console information contained in the certificate.
3736
Console.WriteLine("{0}Subject: {1}{0}", Environment.NewLine, x509.Subject);

0 commit comments

Comments
 (0)