X509Certificate.ToString Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Retourne une représentation sous forme de chaîne de l’objet actif X509Certificate .
Surcharges
| Nom | Description |
|---|---|
| ToString() |
Retourne une représentation sous forme de chaîne de l’objet actif X509Certificate . |
| ToString(Boolean) |
Retourne une représentation sous forme de chaîne de l’objet actuel X509Certificate , avec des informations supplémentaires, le cas échéant. |
ToString()
- Source:
- X509Certificate.cs
- Source:
- X509Certificate.cs
- Source:
- X509Certificate.cs
- Source:
- X509Certificate.cs
- Source:
- X509Certificate.cs
Retourne une représentation sous forme de chaîne de l’objet actif X509Certificate .
public:
override System::String ^ ToString();
public override string ToString();
override this.ToString : unit -> string
Public Overrides Function ToString () As String
Retours
Représentation sous forme de chaîne de l’objet actuel X509Certificate .
Exemples
L’exemple suivant utilise la ToString méthode pour afficher la valeur d’un certificat dans la console.
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
S’applique à
ToString(Boolean)
- Source:
- X509Certificate.cs
- Source:
- X509Certificate.cs
- Source:
- X509Certificate.cs
- Source:
- X509Certificate.cs
- Source:
- X509Certificate.cs
Retourne une représentation sous forme de chaîne de l’objet actuel X509Certificate , avec des informations supplémentaires, le cas échéant.
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
Paramètres
- fVerbose
- Boolean
true pour produire la forme détaillée de la représentation sous forme de chaîne ; sinon, false.
Retours
Représentation sous forme de chaîne de l’objet actuel X509Certificate .
Exemples
L’exemple suivant utilise la ToString méthode pour afficher la valeur d’un certificat dans la console.
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