X509Certificate.ToString 메서드

정의

현재 X509Certificate 개체의 문자열 표현을 반환합니다.

오버로드

Name Description
ToString()

현재 X509Certificate 개체의 문자열 표현을 반환합니다.

ToString(Boolean)

지정한 경우 추가 정보를 사용하여 현재 X509Certificate 개체의 문자열 표현을 반환합니다.

ToString()

Source:
X509Certificate.cs
Source:
X509Certificate.cs
Source:
X509Certificate.cs
Source:
X509Certificate.cs
Source:
X509Certificate.cs

현재 X509Certificate 개체의 문자열 표현을 반환합니다.

public:
 override System::String ^ ToString();
public override string ToString();
override this.ToString : unit -> string
Public Overrides Function ToString () As String

반품

현재 X509Certificate 개체의 문자열 표현입니다.

예제

다음 예제에서는 메서드를 ToString 사용 하 여 콘솔에 인증서의 값을 표시 합니다.

using System;
using System.Security.Cryptography.X509Certificates;

public class X509
{
    public static void Main()
    {
        // The path to the certificate.
        string Certificate =  "Certificate.cer";

        // Load the certificate into an X509Certificate object.
        X509Certificate cert = X509Certificate.CreateFromCertFile(Certificate);

        // Get the value.
        string resultsTrue = cert.ToString(true);

        // Display the value to the console.
        Console.WriteLine(resultsTrue);

        // Get the value.
        string resultsFalse = cert.ToString(false);

        // Display the value to the console.
        Console.WriteLine(resultsFalse);
    }
}
Imports System.Security.Cryptography.X509Certificates




Public Class X509
   
   
   Public Shared Sub Main()
      
      ' The path to the certificate.
      Dim Certificate As String = "Certificate.cer"
      
      ' Load the certificate into an X509Certificate object.
      Dim cert As X509Certificate = X509Certificate.CreateFromCertFile(Certificate)
      
      ' Get the value.
      Dim resultsTrue As String = cert.ToString(True)
      
      ' Display the value to the console.
      Console.WriteLine(resultsTrue)
      
      ' Get the value.
      Dim resultsFalse As String = cert.ToString(False)
      
      ' Display the value to the console.
      Console.WriteLine(resultsFalse)
   End Sub  
End Class

적용 대상

ToString(Boolean)

Source:
X509Certificate.cs
Source:
X509Certificate.cs
Source:
X509Certificate.cs
Source:
X509Certificate.cs
Source:
X509Certificate.cs

지정한 경우 추가 정보를 사용하여 현재 X509Certificate 개체의 문자열 표현을 반환합니다.

public:
 virtual System::String ^ ToString(bool fVerbose);
public virtual string ToString(bool fVerbose);
override this.ToString : bool -> string
Public Overridable Function ToString (fVerbose As Boolean) As String

매개 변수

fVerbose
Boolean

true문자열 표현의 자세한 형식을 생성하려면 입니다. 그렇지 않으면 . false

반품

현재 X509Certificate 개체의 문자열 표현입니다.

예제

다음 예제에서는 메서드를 ToString 사용 하 여 콘솔에 인증서의 값을 표시 합니다.

using System;
using System.Security.Cryptography.X509Certificates;

public class X509
{
    public static void Main()
    {
        // The path to the certificate.
        string Certificate =  "Certificate.cer";

        // Load the certificate into an X509Certificate object.
        X509Certificate cert = X509Certificate.CreateFromCertFile(Certificate);

        // Get the value.
        string resultsTrue = cert.ToString(true);

        // Display the value to the console.
        Console.WriteLine(resultsTrue);

        // Get the value.
        string resultsFalse = cert.ToString(false);

        // Display the value to the console.
        Console.WriteLine(resultsFalse);
    }
}
Imports System.Security.Cryptography.X509Certificates




Public Class X509
   
   
   Public Shared Sub Main()
      
      ' The path to the certificate.
      Dim Certificate As String = "Certificate.cer"
      
      ' Load the certificate into an X509Certificate object.
      Dim cert As X509Certificate = X509Certificate.CreateFromCertFile(Certificate)
      
      ' Get the value.
      Dim resultsTrue As String = cert.ToString(True)
      
      ' Display the value to the console.
      Console.WriteLine(resultsTrue)
      
      ' Get the value.
      Dim resultsFalse As String = cert.ToString(False)
      
      ' Display the value to the console.
      Console.WriteLine(resultsFalse)
   End Sub  
End Class

적용 대상