次の方法で共有


X509Certificate コンストラクタ (IntPtr)

アンマネージ PCCERT_CONTEXT 構造体を識別するハンドルを使用して、X509Certificate クラスの新しいインスタンスを初期化します。

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

構文

'宣言
Public Sub New ( _
    handle As IntPtr _
)
'使用
Dim handle As IntPtr

Dim instance As New X509Certificate(handle)
public X509Certificate (
    IntPtr handle
)
public:
X509Certificate (
    IntPtr handle
)
public X509Certificate (
    IntPtr handle
)
public function X509Certificate (
    handle : IntPtr
)
適用できません。

パラメータ

  • handle
    アンマネージ PCCERT_CONTEXT 構造体を識別するハンドル。

例外

例外の種類 条件

CryptographicException

証明書でエラーが発生しました。次に例を示します。

  • 証明書ファイルが存在しません。

  • 証明書が無効です。

  • 証明書のパスワードが正しくありません。

ArgumentException

handle パラメータが、有効な PCCERT_CONTEXT 構造体を表していません。

解説

このコンストラクタは、Microsoft Cryptographic API の証明書コンテキスト PCCERT_CONTEXT を識別するハンドルを使用して、新しい X509Certificate オブジェクトを作成します。

.NET Framework のセキュリティ

  • SecurityPermission  (アンマネージ コードを実行するために必要なアクセス許可)。SecurityPermissionFlag.UnmanagedCode (関連する列挙体)。LinkDemand (セキュリティ アクション)。
  • SecurityPermission  (アンマネージ コードを実行するために必要なアクセス許可)。SecurityPermissionFlag.UnmanagedCode (関連する列挙体)。InheritanceDemand (セキュリティ アクション)。

プラットフォーム

Windows 98,Windows Server 2000 SP4,Windows CE,Windows Millennium Edition,Windows Mobile for Pocket PC,Windows Mobile for Smartphone,Windows Server 2003,Windows XP Media Center Edition,Windows XP Professional x64 Edition,Windows XP SP2,Windows XP Starter Edition

Microsoft .NET Framework 3.0 は Windows Vista,Microsoft Windows XP SP2,および Windows Server 2003 SP1 でサポートされています。

バージョン情報

.NET Framework

サポート対象 : 3.0,2.0,1.1,1.0

参照

関連項目

X509Certificate クラス
X509Certificate メンバ
System.Security.Cryptography.X509Certificates 名前空間