X509Certificate.ToString メソッド
現在の X509Certificate オブジェクトの文字列形式を返します。
オーバーロードの一覧
現在の X509Certificate オブジェクトの文字列形式を返します。
.NET Compact Framework でもサポート。
[Visual Basic] Overloads Overrides Public Function ToString() As String
補足情報が指定されている場合はその情報を含めて、現在の X509Certificate オブジェクトの文字列形式を返します。
.NET Compact Framework でもサポート。
[Visual Basic] Overloads Public Overridable Function ToString(Boolean) As String
使用例
[Visual Basic, C#, C++] メモ ここでは、ToString のオーバーロード形式のうちの 1 つだけについて、使用例を示します。その他の例については、各オーバーロード形式のトピックを参照してください。
Imports System
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
[C#]
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);
}
}
[C++]
#using <mscorlib.dll>
using namespace System;
using namespace System::Security::Cryptography::X509Certificates;
int main()
{
// The path to the certificate.
String* Certificate = S"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);
}
[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
参照
X509Certificate クラス | X509Certificate メンバ | System.Security.Cryptography.X509Certificates 名前空間