Freigeben über


X509Certificate.ToString Methode

Definition

Gibt eine Zeichenfolgendarstellung des aktuellen X509Certificate-Objekts zurück.

Überlädt

ToString(Boolean)

Gibt eine Zeichenfolgendarstellung des aktuellen X509Certificate-Objekts zurück, optional mit Zusatzinformationen.

ToString()

Gibt eine Zeichenfolgendarstellung des aktuellen X509Certificate-Objekts zurück.

ToString(Boolean)

Quelle:
X509Certificate.cs
Quelle:
X509Certificate.cs
Quelle:
X509Certificate.cs

Gibt eine Zeichenfolgendarstellung des aktuellen X509Certificate-Objekts zurück, optional mit Zusatzinformationen.

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

Parameter

fVerbose
Boolean

true, wenn die ausführliche Form der Zeichenfolgendarstellung gewünscht wird, andernfalls false.

Gibt zurück

Eine Zeichenfolgendarstellung des aktuellen X509Certificate-Objekts.

Beispiele

Im folgenden Beispiel wird die ToString -Methode verwendet, um den Wert eines Zertifikats für die Konsole anzuzeigen.

using namespace System;
using namespace System::Security::Cryptography::X509Certificates;
int 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 );
}
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

Gilt für:

ToString()

Quelle:
X509Certificate.cs
Quelle:
X509Certificate.cs
Quelle:
X509Certificate.cs

Gibt eine Zeichenfolgendarstellung des aktuellen X509Certificate-Objekts zurück.

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

Gibt zurück

Eine Zeichenfolgendarstellung des aktuellen X509Certificate-Objekts.

Beispiele

Im folgenden Beispiel wird die ToString -Methode verwendet, um den Wert eines Zertifikats für die Konsole anzuzeigen.

using namespace System;
using namespace System::Security::Cryptography::X509Certificates;
int 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 );
}
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

Gilt für: