2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

[Windows10] クライアント証明書を生成

Posted at

はじめに

  • ローカル コンピューターに自己署名入りのクライアント証明書を作成する。
  • Azure PowerShell モジュールを備えた PowerShell と Windows 証明書マネージャー ユーティリティを使用

手順

PowerShell: 自己署名入りのルート証明書を作成


$cert = New-SelfSignedCertificate -Type Custom -KeySpec Signature `
-Subject "CN=P2SRootCert" -KeyExportPolicy Exportable `
-HashAlgorithm sha256 -KeyLength 2048 `
-CertStoreLocation "Cert:\CurrentUser\My" -KeyUsageProperty Sign -KeyUsage CertSign

PowerShell: 新しいルート証明書によって署名されたクライアント証明書を生成


New-SelfSignedCertificate -Type Custom -DnsName P2SChildCert -KeySpec Signature `
-Subject "CN=P2SChildCert" -KeyExportPolicy Exportable `
-HashAlgorithm sha256 -KeyLength 2048 `
-CertStoreLocation "Cert:\CurrentUser\My" `
-Signer $cert -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.2")

証明書マネージャー: 証明書の公開キーをエクスポート

証明書マネージャーをPowerShellから開く

certmgr

証明書マネージャーで以下を実行

1. [個人] > [証明書] の順に移動します。
2. リスト内の P2SRootCert 証明書を右クリックし、[すべてのタスク] > [エクスポート] の順に選択します。
3. 証明書のエクスポート ウィザードで、[次へ] をクリックします。
4. [いいえ、秘密キーをエクスポートしません] が選択されていることを確認し、[次へ] をクリックします。
5. [エクスポート ファイルの形式] ページで [Base-64 encoded X.509 (.CER)] が選択されていることを確認し、[次へ] をクリックします。
6. [エクスポートするファイル] ページの [ファイル名] で、覚えやすい場所を参照して、P2SRootCert.cer としてファイルを保存してから、[次へ] をクリックします。
7. [証明書のエクスポート ウィザードの完了] ページで、[完了] をクリックします。
8. [認定資格証のエクスポート ウィザード] メッセージ ボックスで [OK] をクリックします。

参考

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?