X509Certificate.ToString メソッド (Boolean)
補足情報が指定されている場合はその情報を含めて、現在の X509Certificate オブジェクトの文字列形式を返します。
Overloads Public Overridable Function ToString( _
ByVal fVerbose As Boolean _) As String
[C#]
public virtual string ToString(boolfVerbose);
[C++]
public: virtual String* ToString(boolfVerbose);
[JScript]
public function ToString(
fVerbose : Boolean) : String;
パラメータ
- fVerbose
詳細な文字列形式を生成する場合は true 。それ以外の場合は false 。
戻り値
現在の X509Certificate オブジェクトの文字列形式。
使用例
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++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ, .NET Compact Framework - Windows CE .NET
参照
X509Certificate クラス | X509Certificate メンバ | System.Security.Cryptography.X509Certificates 名前空間 | X509Certificate.ToString オーバーロードの一覧