X509Certificate.CreateFromCertFile メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > X509Certificate.CreateFromCertFile メソッドの意味・解説 

X509Certificate.CreateFromCertFile メソッド

指定した証明書ファイルから X.509v3 証明書作成します

名前空間: System.Security.Cryptography.X509Certificates
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Public Shared Function CreateFromCertFile
 ( _
    filename As String _
) As X509Certificate
Dim filename As String
Dim returnValue As X509Certificate

returnValue = X509Certificate.CreateFromCertFile(filename)
public static X509Certificate CreateFromCertFile
 (
    string filename
)
public:
static X509Certificate^ CreateFromCertFile (
    String^ filename
)
public static X509Certificate CreateFromCertFile
 (
    String filename
)
public static function CreateFromCertFile
 (
    filename : String
) : X509Certificate

パラメータ

filename

X.509 証明書作成の証明ファイルパス

戻り値
新しく作成されX.509 証明書

例外例外
例外種類条件

ArgumentException

filename パラメータnull 参照 (Visual Basic では Nothing) です。

解説解説

ASN.1 DER は、このクラスサポートされている唯一の証明書形式です。

使用例使用例
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 

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);
  
    }

}
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 );
}

import System.*;
import System.Security.Cryptography.X509Certificates.*;

public class X509
{
    public static void main(String[]
 args)
    {
        // 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);
    } //main 
} //X509
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
X509Certificate クラス
X509Certificate メンバ
System.Security.Cryptography.X509Certificates 名前空間



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「X509Certificate.CreateFromCertFile メソッド」の関連用語

X509Certificate.CreateFromCertFile メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



X509Certificate.CreateFromCertFile メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS